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?
I know how to create links to Confluence pages using the RemoteIssueLinkBuilder, but there isn't an application type for Opsgenie....
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)
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.