Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Retrieving Linked JSM Issue with Opsgenie API

Tom Russell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2023

We've just purchased JSM and moved our Opsgenie instance under that umbrella. We're using the JSM integration so alerts in Opsgenie are creating issues in JSM.

In the Opsgenie GUI, we can see the linked issue, but how do we get that JSM issue ID with the Opsgenie API?

1 answer

0 votes
Tom Russell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2023

One work-around we're exploring for this is querying the alert logs:

https://docs.opsgenie.com/docs/alert-api-continued#list-alert-logs

We're seeing a log entry that gives the JSM ID and can be parsed. Here's what one looks like:

{
    "log": "jira-service-management-cloud [JSM Tech Support Hub Alert Integration] ExecutionStatus[succeed] Issue created with id: [17308] key: [TSH-7154]",
    "type": "system",
    "owner": "System",
    "createdAt": "2023-02-21T14:01:41.712Z",
    "offset": "1676988101000_1676988101712151000"
}

The problem with this is how/when to do this. I guess we can setup an OEC that executes for all JSM-eligible alerts. Have it sleep for a bit, query the logs, and then add the JSM id back to the alert as a tag. Still seems a bit of a kludge. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events