This article outlines how to extract fields and data into an alert that are not offered through an integration by default.
The Advanced tab of an integration shown below is only available only on the standalone Opsgenie Standard and Enterprise plans, and the JSM/O Premium and Enterprise plans.
These methods can still be applied to extract fields and data into the tags or extra properties fields on the Opsgenie Free and Essentials plans, and the JSM/O Free and Standard plans:
If a field and/or data is being parsed in the payload, it can be extracted into an alert using string processing or regular expressions (regex).
Each Opsgenie integration offers a number of draggable dynamic fields. These can be added into an alert to parse data and construct rich, informative, customized alerts.
Some 3rd party sources send custom fields to Opsgenie which are not offered through an integration by default. As long as the field is being parsed in the payload, it can be extracted into Opsgenie alert fields using string processing or regex.
If a field is not parsed into an alert as expected, check the Logs Tab to review whether or not it was parsed in the payload.
Logs can be searched by timestamp and/or strings. Specifically the Processed incomingData and Received integration request logs will show what data is being parsed in the payload:
With some integrations such as Jira and JSM, workflows require custom fields to be entered when creating an issue. These custom fields are not included by default in the Jira and JSM integrations, but still parse in the payload of the alert:
Note - There are some limits to the Logs where data parsed can be truncated:
With cases like this it’s best to extract the entire payload into the alert’s description field (which has a max character limit of 15000 characters). This can be done under the Advanced tab of an integration using {{_payload}} to determine if the custom field is being parsed in the payload, and can then be extracted into the alert:
Leveraging a JSON formatter can be an easier way to understand the formatting of how a field is being parsed:
As shown above, the custom field is nested. A dynamic field such as:
{{_payload.issue.fields.customfield_10048}}
can then be used to extract the value into an alert field(s):
* Since Jira, JSM and other integrations format data and custom fields differently through nesting, lists, arrays, webhook URL, headers, etc. it depends on how the field is being parsed in the payload.
Again - as long as a field and/or data is being parsed in the payload, it can be extracted into the alert using string processing or regex:
In regard to Jira and JSM, customers have leveraged some of these options to extract a custom field:
Legacy Integration:
{{_payload.issue.fields.customfield_00000}}
{{_payload.issue.fields.customfield_00000.name}}
{{_payload.issue.fields.customfield_00000.value}}
{{_payload.issue.fields.customfield_00000.substringBetween("value=",",")}}
{{_payload.issue.fields.substringBetween("customfield_00000=",",")}}
Cloud Integration:
{{customFields.customfield_00000}}
{{customFields.customfield_00000.name}}
{{customFields.customfield_00000.value}}
{{customFields.customfield_00000.substringBetween("value=",",")}}
In order to ensure that we continue to provide useful content, please let us know if this Article is helpful (Thumbs Up/Down). Also, to help us improve, feel free to provide additional feedback (directly in the community).
Nick Haller
Technical Support Engineer
Atlassian
Boston
357 accepted answers
4 comments