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

ScriptRunner - How to link JSM Incident to Opsgenie Incident

Scott Boisvert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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

1 vote
Answer accepted
scott_boisvert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2021 edited

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)

  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Service Management Events