Map the Response Payload for an alert webhook: External Name and ID
This is Step 4 in the procedure for creating a new outbound alert webhook.
When the webhook sends a CREATE or UPDATE notification, the external system sends a response back to Moogsoft Cloud which includes the name or ID for the external ticket, or the equivalent.
An outbound webhook can extract the external ticket name or ID from the response sent from the external system and store the information in the alert or incident that triggered the notification. It can also store a URL to the external ticket in the alert or incident. You can view this information when you view the Outbound tab for alert or incident details in the UI.
When you complete the information in this step, you have built either a JSON path to the relevant field, or a regex.
Complete the following information so Moogsoft knows where to find the information in the response.
External Name and ID
NOTE: To reset the settings and start over, select None as the External Webhook Target.
External Webhook Target
Select the type from the list which describes the external system, or User Defined for a custom attribute lookup.
Attribute key with the External Name or Attribute key with the External ID
One or both (depending on the system type) of these fields populate automatically if you selected one of the options in the External Webhook Target list.
In most cases, you can select your target system from the list and the rest of the fields automatically populate. If your system type is not included in the list, however, you can select User Defined from the External Webhook Target list and manually configure the information.
The User Defined option allows you to manually configure the Attribute key with the External Name and/or Attribute key with the External ID.
You can specify a regular expression to extract the ticket ID or name.
For example, if the external system defines tickets like this:
"issueID" : "11450"
You can define the attribute key like this, using a regular expression: \"issueId\":\s*\"(\d+)\"
Note that the expression should use parentheses to indicate the value.
Important
To check a regular expression is valid, you can run a test of the Webhook via the user interface. First, locate the needed text in the response body that may include the Name. Next, paste this into the regular expression text box, and then add the slashes to escape the regular expression where needed. Note that the triggers need to specify when to perform an UPDATE operation for each webhook. There are several options to choose from.
External Link URL
An optional URL to the ticket on the external system.
This field defines a clickable link that allows you to open the item (such as a ticket) created by this webhook. You can use ${outbound.<integration_name>.external_name}
and ${outbound.<integration_name>.external_id}
to construct the URL.
In some cases, the remote system will include the URL in the response body when a TEST is run from the user interface at the top of the page. Locate the Response section of the Create Operation Details. You should see a line that resembles:
"url": "https://name.example_system.com/api/v2/tickets/1293",
The External Link URL is the URL portion (in the above example, https://name.example_system.com/api/v2/tickets/, plus the identifying information (ID or name) for the ticket.
If the URL is not included in the response from the external system, but the main URL is known, the external link URL can be built manually for example:
https://name.example_system.com/tickets/${outbound.<integration_name>.external_name}
(where <integration_name> is the name of the alert webhook.