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.
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.
https://api.opsgenie.com/v1/incidents?query=postmortemStatus%3Ano-postmortem
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Wolfgang Kandek,
You can use the following query parameters for postmortemStatus:
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From those queries that return incidents how do I find the associated post-mortem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
John, that requires the postmortemid? Where do I get it from?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
We have a similar use case as well, what is the workaround at this moment, Is the UI seen as able to provide the association, and what is the equivalent to API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.