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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Add Issue Key and URL to Incident


Dear all,

i am using opsgenie ,OEC and Python Script for creating some jira issues with some custom jira fields which are not filled by default,the synchronization opsgenie-jira works fine and the jira tickets are created.I use the following scenario:

  • I select e.g an alert and create manually for this alert an incident.
  • Incident itself creates an R alert and based on some rules which i defined,the R alert triggers the ticket creation.

But i would like also to have within Incident the Issue Key and URL under Extra Properties,like below:
Issue Key.JPG

Could you pls give me a hint how to achieve this?I use this py script

Oltion Alimerko

1 answer

0 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 14, 2022

Hi @Oalimerko ,


You could have the script add those fields to the Incident via Incident API. The responder alert that is triggering your script will have the incident-id as an Extra Property




So you could have your script use that incident-id for the API request to update the incident fields with those additional fields.


Hope this helps!




Hi @Samir ,

i am not sure if i got it right.Do you mean first create incident manually and then update it via API or create the incident directly via API?

Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 14, 2022

@Oalimerko It sounds like the responder alert created from the incident is triggering OEC to create the issue in Jira, right?

If so - that means the incident is being created before the Jira issue is being created.

So I was thinking modify the script that is creating the Jira issue, so that after it gets the response from Jira that the issue was created, it updates the incident with the additional fields via Incident API.

@Samir ,
now i got your idea.But how can the script gets the response from Jira that the issue was created,especially how to get the issue key?
In order to update the incident,first i need the incidentId of respective incident,how to get it?

Do you have any code example?

Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 14, 2022


I don't have an example of the script. But the script is receiving the details of the responder alert from Opsgenie, which is then used to create the issue in Jira. So you could make another Get Alert API request back to Opsgenie to get all the responder alert fields (the incident-id  field is an extraProperty of the responder alert as shown in my screenshot in my initial reply).

So you can grab that incident-id and assign it to a variable in the script.

Then when it makes the request to Jira to create the issue via API, it then grabs the response of that api request (line 256 below) and grabs the issueKey that is returned, and then adds that issueKey as an extra property to the alert.


So you could add lines there for it to then make an Add Details to Incident API Request (since you have the incident-id), and add the Jira issueKey and link to jira issue as details (i.e. extra Properties) to the incident.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events