Skip to main content
When configuring alerts you can choose to extract specific fields you care about from the JSON payload of your alert. You can manage this by navigating to Alerts > Sources and editing the alert source you wish to extract information from. While editing the alert, click on the icon in the attributes section. The Attributes section of an alert source, with a Suggested attribute card and a Review button Once you are ready to add a new attribute, you can choose to add attributes through the use of AI, we will parse through the payload and suggest attributes that are commonly seen and can be linked to a catalog type. Or you can choose to link an existing attribute or start from scratch by parsing the payload directly. Found suggested attributes, offering Accept or Skip for a parsed Team attribute

Extracting fields from JSON

You can see the alert payload for all the alerts you’ve received. Write your query in the step Then extract fields from JSON. By default, use $ to reference the payload, then access fields like $.field, or $.items[0].name. For logic the $ syntax can’t express, such as filtering or reshaping an array, use the </> toggle on the field to switch to JavaScript.
JavaScript here doesn’t support ES6 language features. This means there is no support for arrow functions, template literals, some string functions, and other features listed here
The Then extract fields from JSON step with the query $.issue.severity and a preview of MEDIUM

Options to extract values from the payload

1. Extract a simple field

If you click on any field displayed in the payload, you’ll automatically see this value extracted. For example, to extract the service field from your metadata, use
This will dynamically fetch whichever value is in the service field and apply it to your alert.

2. Map array fields

To map an array field, switch the field to JavaScript with the </> toggle. In our JSON payload, our tags field has the following format:
To filter only certain values from our tags, we can use JavaScript filtering:
To map your array, you can also use standard JavaScript functions:
To ensure that your output preserves all values from your array, select Result is an array. Otherwise, your result will just select the first value of your array. The Choose what the result should be parsed into step, set to String with Result is an array ticked

3. Write a custom JavaScript snippet

JavaScript here supports ES5, so you can write custom code that will allow you to get creative on how you extract values from the payload. If you’re a bit rusty with JavaScript then it can also be well worth asking an AI coding assistant to help write any given expression - a prompt of ” write an expression to do x in JavaScript using only ES5 ” usually works quite well