Hi,
I am creating simple integration that would allow us to open and close alerts in JSMOPS. Creation works as expected, no issues here. Problem is with closing an alert, but according to https://developer.atlassian.com/cloud/jira/service-desk-ops/rest/v2/api-group-alerts/#api-v1-alerts-id-close-post (or https://developer.atlassian.com/cloud/jira/service-desk-ops/rest/v1/api-group-integration-events/#api-jsm-ops-integration-v2-alerts-id-close-post) we need id. Unfortunately on creation of alert we don't get its id.
I have few questions related to this:
- is it possible to create alert and get its id at the same time?
- if not, how can I close alert not knowing the id? can I use alias instead? listing alerts to get id seems quite expensive way to do it
Thanks
Michał
@Michał Margula unfortunately, because alert creation is an asynchronous process, you need to save the request ID from the alert creation call, then periodically call Get Request Status (https://developer.atlassian.com/cloud/jira/service-desk-ops/rest/v2/api-group-alerts/#api-v1-alerts-requests-id-get) until the alert is processed and the alert ID is returned.
For closing an alert; in the old Opsgenie API (https://docs.opsgenie.com/docs/alert-api#close-alert) there is a parameter (identifierType) that allowed you to specify that the ID was the alias. I don't see that in the JSM Ops Alert API. You could try adding that parameter and see if it's implemented, but not documented. If it doesn't work, there's probably a case to be made with Atlassian to add that parameter.
Hey @Tom Russell
It seems that `?identifierType=alias` still works! I would never thought of trying that out.
Cheers
M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.