The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Newrelic condition_description field not present in OpsGenie Newrelic New integration templating

steven.falconieri
March 7, 2022

Setting a custom violation description in NewRelic does not seem to be accessible in the OpsGenie NewRelic New integration parsed variables. 

Is there a way to access this field from the payload sent by NewRelic using variable interpolation ?

Eg. 
```
{{ raw.payload.condition_description }}
```

 

https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/advanced-alerts/advanced-techniques/alert-custom-violation-descriptions/

https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-new-relic-alerts-new/ 

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
steven.falconieri
March 10, 2022

Update: 
@Nick Haller helped confirm that the format for rendering the custom condition description is. 


{{_payload.payload.condition_description}}
LL92
October 3, 2023

Can you update the documentation below regarding custom attributes?
Integrate Opsgenie with New Relic Workflows | Opsgenie | Atlassian Support

Roger Venning
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2024

This also helped me acquire custom properties (in this case, the associated entity to the SLI/SLO definition).

I would love documentation update; and also would like it noted that there must be no space padding around {{ }} and the variable _payload...

0 votes
Nick Haller
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2022

Hi @steven.falconieri ,

If this field / data is parsing in the payload, you should be able to extract it using either String Processing or Regex.

It would realistically depend on how the condition_description is parsing in the payload, but maybe try:

{{payload.condition_description}}

 

Feel free to also share a what the payload looks like in the Processed incomingData log either with a screenshot or copy/paste it here - as long as you are comfortable sharing.  

steven.falconieri
March 8, 2022

Thanks @Nick Haller , that suggestion definitely makes it much more obvious whats happening. 

It appears that although the payload being received includes the `condition_description` field it is is not part of the `_parsedData`. 

Might i suggest a feature request to include the raw payload in the parsed data or are there potential security implications in doing so. 




Parsed data
```
{ "_incomingData": { "_parsedData": {
"-originalTags": [ "og_priority:P2", "service.name:android" ],
"target_name": "Transaction query",
"incident_acknowledge_url":
"https://alerts.newrelic.com/accounts/XXXX/incidents/XXXX/acknowledge",
"event_type": "INCIDENT",
"incident_id": "XXXX",
"target_link": "https://insights.newrelic.com/accounts/XXXX/query?query=SELECT%2010%20From%20Transaction%20%20TIMESERIES%201%20minute%20SINCE%20%272022-03-08%2015%3A52%3A13%27%20UNTIL%20%272022-03-08%2021%3A51%3A13%27",
"_target_labels_map": {},
"delayIfDoesNotExists": "true",
"details": "Transaction query result is > 1.0 for 1 minutes on 'test og custom desc'",
"state": "open",
"condition_name": "test og custom desc",
"target_product": "NRQL",
"timestamp": "1646776273605",
"owner": "",
"severity": "CRITICAL",
"policy_url": "https://alerts.newrelic.com/accounts/XXXX/policies/XXXXXX",
"-recipients": [],
"target_type": "Query",
"policy_name": "TEST",
"incident_url": "https://alerts.newrelic.com/accounts/xxxxx/incidents/xxxxx",
"priority": "CRITICAL",
"-teams": [],
"runbook_url": "null",
"-tags": [ "og_priority:P2", "service.name:android" ],
"-target_labels": [ {} ] },
"integrationType": "NewRelicV2",
"integrationName": "NewRelic [dev]",
"integrationId": "xxxx",
"incomingDataId": "xxxx"
} }

```



Raw payload received
```
{ "_incomingData": { "integrationType": "NewRelicV2", "_payload": "
{\"apiKey\":\"xxx\",
\"teams\":\"\",\"payload\":{\"account_id\":xxx,
\"account_name\":\"xxxxx\",\
"condition_id\":xxxx,
\"condition_name\":\"test og custom desc\",
\"condition_description\":\"This is a custom description field\",
\"current_state\":\"open\",
\"details\":\"Transaction query result is > 1.0 for 1 minutes on 'test og custom desc'\",
\"incident_acknowledge_url\":\"https://alerts.newrelic.com/accounts/xxxx/incidents/xxxxx/acknowledge\",\"incident_id\":xxxx,
\"incident_url\":\"https://alerts.newrelic.com/accounts/xxxxx/incidents/xxxxx\",\"owner\":\"\",
\"policy_name\":\"TEST\",
\"policy_url\":\"https://alerts.newrelic.com/accounts/xxxxx/policies/xxxxxx\",
\"open_violations_count\":{\"critical\":1,\"warning\":0},\"closed_violations_count\":{\"critical\":0,\"warning\":0},\"severity\":\"CRITICAL\",\"targets\":[{\"id\":\"Transaction\",\"name\":\"Transaction query\",\"link\":\"https://insights.newrelic.com/accounts/xxxxxx/query?query=SELECT%2010%20From%20Transaction%20%20TIMESERIES%201%20minute%20SINCE%20%272022-03-08%2015%3A52%3A13%27%20UNTIL%20%272022-03-08%2021%3A51%3A13%27\",\"labels\":{},\"product\":\"NRQL\",\"type\":\"Query\"}],\"timestamp\":xxxxx,\"timestamp_utc_string\":\"2022-03-08, 21:51 UTC\",\"event_type\":\"INCIDENT\",\"version\":\"1.0\",\"violation_callback_url\":\"https://insights.newrelic.com/accounts/xxxxxx/query?query=SELECT%2010%20From%20Transaction%20%20TIMESERIES%201%20minute%20SINCE%20%272022-03-08%2015%3A52%3A13%27%20UNTIL%20%272022-03-08%2021%3A51%3A13%27\",\"duration\":469,\"condition_family_id\":xxxxx,\"metadata\":{\"evaluation_system_source\":\"Willamette\"}},\"recipients\":\"\",\"tags\":\"og_priority:P2,service.name:android\"}", "_httpParams": {}, "httpUrl": "/v2/json/newrelic", "incomingDataId": "xxxxx", "_httpHeaders": { "User-Agent": "okhttp/4.9.1", "X-Amz-Cf-Id": "xxxx", "X-Forwarded-For": "xxxx", xxxx, xxxx, xxxx", "Accept-Encoding": "gzip", "Content-Length": "xxx", "X-Amzn-Trace-Id": "Self=1-xxx-xxx;Root=1-xxxx-xxxx", "Content-Type": "application/json" } }, "_actionSource": { "_details": { "ownerType": "NewRelicV2", "clientIpAddress": "xxxx", "writeAccessGranted": "true", "configAccessGranted": "false", "deleteAccessGranted": "true", "ownerId": "xx-xxx", "ownerDomain": "integration", "readAccessGranted": "true" }, "type": "API" } }

```

Nick Haller
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2022

Thanks for sharing that. Based on the payload shared, you may be able to simply use:

{{condition_description}}

to extract that field. If either of those suggestions do not work - feel free to open a ticket with support here: https://support.atlassian.com/opsgenie/

You can even reference this Community post and Nick H., and I'll try to pick that up! We might need to take a deeper look into the account / logs. 

steven.falconieri
March 10, 2022

Thanks for the suggestion @Nick Haller but my testing with `{{condition_description}}` was unsuccessful. I have raised a support ticket OGSP-85926 as you suggested. 

Really appreciate the help on this. 

Like Nick Haller likes this
TAGS
AUG Leaders

Atlassian Community Events