From e83377ee3654c94a1aae9f9365b77cbfd1a08584 Mon Sep 17 00:00:00 2001 From: Andreu Belmonte <6041277+andreub@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:54:11 +0100 Subject: [PATCH 1/2] Add path_expression to site24x7_webhook_integration --- site24x7/integration/webhook.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/site24x7/integration/webhook.go b/site24x7/integration/webhook.go index 912faf1..88581ab 100644 --- a/site24x7/integration/webhook.go +++ b/site24x7/integration/webhook.go @@ -148,6 +148,11 @@ var WebhookIntegrationSchema = map[string]*schema.Schema{ Optional: true, Description: "Configuration to handle ticketing based integration.", }, + "path_expression": { + Type: schema.TypeString, + Optional: true, + Description: "JSON Path/XPath expression to obtain the ticket id of the request created.", + }, "update_url": { Type: schema.TypeString, Optional: true, @@ -354,6 +359,7 @@ func resourceDataToWebhookIntegration(d *schema.ResourceData) (*api.WebhookInteg Tags: tagIDs, AlertTagIDs: alertTagIDs, ManageTickets: d.Get("manage_tickets").(bool), + PathExpression: d.Get("path_expression").(string), UpdateURL: d.Get("update_url").(string), UpdateMethod: d.Get("update_method").(string), UpdateSendIncidentParameters: d.Get("update_send_incident_parameters").(bool), @@ -416,6 +422,7 @@ func updateWebhookIntegrationResourceData(d *schema.ResourceData, webhookIntegra d.Set("alert_tags_id", webhookIntegration.AlertTagIDs) // Manage tickets configuration d.Set("manage_tickets", webhookIntegration.ManageTickets) + d.Set("path_expression", webhookIntegration.PathExpression) // Update Ticket d.Set("update_url", webhookIntegration.UpdateURL) d.Set("update_method", webhookIntegration.UpdateMethod) From 514302fb1bebd9fc0f818b8f5608bb39d911f20b Mon Sep 17 00:00:00 2001 From: Andreu Belmonte <6041277+andreub@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:47:09 +0100 Subject: [PATCH 2/2] Update webhook.go --- site24x7/integration/webhook.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/site24x7/integration/webhook.go b/site24x7/integration/webhook.go index 88581ab..64ae99a 100644 --- a/site24x7/integration/webhook.go +++ b/site24x7/integration/webhook.go @@ -148,6 +148,12 @@ var WebhookIntegrationSchema = map[string]*schema.Schema{ Optional: true, Description: "Configuration to handle ticketing based integration.", }, + "response_format": { + Type: schema.TypeString, + Default: "J", + Optional: true, + Description: "Expected response type for ticketing based integration: J(ason) or X(ml)", + }, "path_expression": { Type: schema.TypeString, Optional: true, @@ -359,6 +365,7 @@ func resourceDataToWebhookIntegration(d *schema.ResourceData) (*api.WebhookInteg Tags: tagIDs, AlertTagIDs: alertTagIDs, ManageTickets: d.Get("manage_tickets").(bool), + ResponseFormat: d.Get("response_format").(string), PathExpression: d.Get("path_expression").(string), UpdateURL: d.Get("update_url").(string), UpdateMethod: d.Get("update_method").(string), @@ -422,6 +429,7 @@ func updateWebhookIntegrationResourceData(d *schema.ResourceData, webhookIntegra d.Set("alert_tags_id", webhookIntegration.AlertTagIDs) // Manage tickets configuration d.Set("manage_tickets", webhookIntegration.ManageTickets) + d.Set("response_format", webhookIntegration.ResponseFormat) d.Set("path_expression", webhookIntegration.PathExpression) // Update Ticket d.Set("update_url", webhookIntegration.UpdateURL)