Missed Team ’24? Catch up on announcements here.

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

Incident "Events" from JSM

Ken Young
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.
September 27, 2023

Hi Again,

We are using JSM in it's current OpsGenie(Alerts) -> JSM(Incidents) configuration that the OpsGenie->JSM integration provides.  As such, we are not using OpsGenie incidents.   We are, however, linking linking services to our JSM Incident tickets (using Automation) though by doing a service lookup by name via the OpsGenie API.

In looking up the "service" via the LookupObject automation component, we can retrieve the service.  In the JSM UI it with also show the Compass component (if you have it linked), but the lookup object doesn't seem to contain the compass component, or the id/link.  

Our ultimate goal is that when a incident is opened in JSM (with a service assigned to the incident), it create a corresponding "Incident" event in Compass.  Would be best if I didn't have to write it, but looking to utilize the REST API  to accomplish this. My question is if I am targeting a specific component/service in the event request body, how do you indicate that, and how do you lookup the Id dynamically if Automation doesn't currently support GraphQL (or what alternatives are there)

 

Thank you

Ken

2 answers

1 accepted

1 vote
Answer accepted
Ken Young
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.
October 5, 2023

To close the loop on this if this helps anyone creating an Incident Event.  I was eventually able to do this with Jira Automation on the GraphQL gateway.  

Graphql queries/mutations need to be converted into rest format in order to utilized in in the Web Request component.   To help in converting Queries/Mutations, I has some success with the "GraphQL to REST queries" available on the  VS Code Marketplace

The first step was to execute a query against the GraphQL Gateway to retrieve a Compass component by it's Name.

 

lookupComponent.png

Next was to validate that a single eventsource was returned in the webResponse.  The total #  of components is found by using the following smart value 

{{webResponse.body.data.compass.searchComponents.totalCount}} 

After confirming that a component was retreived, the For Each Advance Branching was utilized to loop over the components event sources.

{{webResponse.body.data.compass.searchComponents.nodes.first.component.eventSources}}

flow_findexternaleventsource.png

 

After retrieving the Incident externalEventSourceId, variables for start DateTime and updated DateTime were created separately so they could be formatted specifically for Graphql.  Note: the smart values date and time formatter for jiraDateTime is the correct format, but the formatter doesn't seem to be currently working as documented.

To create the actual Incident Event in Compass,  a mutation using the related JSM Incident issue information is sent via a web request.

webrequest_incidentmutation.png

I am hoping this is helpful.

0 votes
Ken Young
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.
September 28, 2023

After a bit more investigation, I have found the answer to using Automation's web request function to do queries and mutations into Compass. (Link ) After crafting a query to pass in the service name, I can find the correct Component., as well as the eventsources's related to that component.  So hopefully I now have all of the data to post/mutate events with an external url back to the JSM "incident" ticket.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events