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
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.
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}}
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.
I am hoping this is helpful.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.