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: 

ScriptRunner - How to link JSM Incident to Opsgenie Incident

Scott Boisvert
Community Champion
April 13, 2021

We have Jira Service Management on Data Center and Opsgenie. I've figured out how to create an incident in Opsgenie and get the Incident ID back from Opsgenie using ScriptRunner and the Opsgenie REST API. What I need to do from here I'm a little lost, how do you create a link to the incident in Opsgenie on the JSM incident?

Linked Incidents.jpg

I know how to create links to Confluence pages using the RemoteIssueLinkBuilder, but there isn't an application type for Opsgenie....

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
scott_boisvert
Community Champion
April 19, 2021

Figured this out with some help from KD at Adapativst. I was looking for a special link type to write the code to, when in actuality this information is stored in new custom field called Linked major incidents, which returns/accepts an array.

Here's an example of the code I was able to use to update the field:

def linkedMajorIncidents = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("Linked major incidents")
issue.setCustomFieldValue(linkedMajorIncidents[0], [incidentId])
ComponentAccessor.getIssueManager().updateIssue(issue.reporter, issue, EventDispatchOption.DO_NOT_DISPATCH, false)

  

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events