Querying API to list incidents

I am querying the api to list incidents here https://api.pagerduty.com//incidents with the query of where status is acknowledged or triggered. The services where these incidents are routed to are Service Now integrated and have a service now incident # assigned to them.

I am able to get all of the information I need with the exception of that service now incident number. Is the SN incident number supposed to be in the incident payload, or is it located somewhere else?

Thank you,
Dave

This isn’t possible using our out-of-the-box integration with ServiceNow. It may be possible by customising things on the SNow side, but we’re unable to assist with any such customisations at this time. The info you’re after does get included in the webhooks PagerDuty sends to SNow, but not in the payload they get from currently available PagerDuty API endpoints.

Having some ability to store metadata in the incident object is something that I’ve found myself wishing for as well. While my company uses a different ticketing system than SN, we also wanted the link between the two services. Allowing anyone in our ticket to see the incident link of PagerDuty and for anyone in PagerDuty to find the ticket.

I had to get creative and set our ticketing system up to add a note into PagerDuty, listing the ticket number and a link back. It doesn’t make queries easier, though, because I also need to scrape the incident annotations instead of just the incident itself.

1 Like

image

It’s interesting because it does show up on the incident screen in Pagerduty, We use grafana as a dashboard system and would like to include it there. Ill have to take a look a little deeper and see if I can find something .

If you add include[]=external_references to your API request you will get the ServiceNow reference back.

Happy Friday!

Doug - It’s beautiful, thank you!

1 Like

Anytime - have a great weekend!