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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,456,275
Community Members
 
Community Events
176
Community Groups

Find the post-mortem assocaied with an incident via API

I would like to find the post-mortem associated with an incident via the API, but I cannot find the post-mortem reference in the the Incident itself.

There is an incident in the post-mortem API, but there seems no also seems no way to list post-mortems.

My purpose is to ensure that P1/P2 incidents have a post-mortem and that it follows out format and agreements (for example - a Jira ticket is needed for each Action item). The initial ideas was to list Incidents that are closed/resolved and see whether they have a post-mortem. If so get the post-mortem and review the content for format and ticket links. If not, create post-mortem in our format and notify the incident owner that a post-mortem skeleton had been created.

 

1 answer

1 vote
Darryl Lee Atlassian Team Dec 15, 2022

Hi @Wolfgang Kandek,

This is Darryl. I am here to help. 😀

Understand that you would like to leverage Opsgenie Incident API to list out the Opsgenie Incidents which don't have a Postmortem yet.

The endpoint

https://api.opsgenie.com/v1/incidents?query=postmortemStatus%3Ano-postmortem

Reference

We recommend tailoring the `query` inline parameter in the URL when making the API request.

The List Incident API documentation is -> https://docs.opsgenie.com/docs/incident-api#list-incidents

The Search Syntax for Incidents documentation is a great reference for you to adjust your query -> https://support.atlassian.com/opsgenie/docs/search-syntax-for-incidents/

Last, please encode the URL with the reference -> https://www.w3schools.com/tags/ref_urlencode.ASP


Hope this helps.

Kind regards,
Darryl Lee
Support Engineer, Atlassian

Daryl, that helps with one of my issues, i.e. an incident that does not have a post-mortem.

But I would also like to access the incidents that have a post-mortem and verify the format used:

- Sections that we have as mandatory
- Jira tickets for action items
- etc

John M Atlassian Team Dec 16, 2022

Hi @Wolfgang Kandek,

You can use the following query parameters for postmortemStatus:

  • no-postmortem
  • published
  • in-review
  • draft

If you want to only include incidents that have a published postmortem, you can use the following endpoint with 'published' as the value for the 'postmortemStatus' query parameter:

From those queries that return incidents how do I find the associated post-mortem?

John M Atlassian Team Dec 16, 2022

@Wolfgang Kandek You would need to use the Get Postmortem Request API, using the incident ID returned from the List Incidents endpoint. 

https://docs.opsgenie.com/docs/postmortem-api#get-postmortem-request

John, that requires the postmortemid? Where do I get it from?

John M Atlassian Team Dec 16, 2022

It looks like right now the only way to get the postmortemid is to create a postmortem via the API (in which case it will return the id) or in the UI, go to Analytics >> postmortem reports (id is in the URL)

I have found that there is a feature request to add this functionality to the API:

https://jira.atlassian.com/browse/OPSGENIE-41

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events