filtering for incidents with no priority


(Basma Asaad) #1

Hi I am trying to get a list of incidents that don’t have their priority set-up.

curl -X GET --header ‘Accept: application/vnd.pagerduty+json;version=2’ --header ‘Authorization: Token token=*******************’ ‘[]=resolved&urgencies[]=high&time_zone=EST&priority=null

using &priority=null’ but I am still getting all the incidents … I am not sure what I am doing wrong.

(Monica Hom) #2

Hi Basma,

Could you try this:

curl -X GET --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Authorization: Token token=TOKEN-HERE' ''

Please note that this endpoint only works for Triggered incidents. For information about Resolved incidents you would need to use the log entries endpoint.

You could also exclude priority instead of setting it as null.


(Basma A) #3

Hi Monica,
What I am trying to accomplish is getting a list of incident that doesn’t have priority yet … when running the above curl you provided I am getting a full list of incidents …

(Thomas Roach) #4

You are able to use the following curl to get a list of triggered incidents that have no priority set.

curl -X GET --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Authorization: Token token=TOKEN-HERE' ''

Note that this will not work for resolved incidents. For resolved incidents, you can use the log_entries endpoint.

(Basma Asaad) #5

Hi Thomas,
If I use the above curl I am getting even the incidents which have their priorities setup too.

(geeth) #6

Hi Basma, the best way to view incidents with/without priority is to obtain a list of all incidents via that Curl command and then parse through to filter the list of incidents with the entry for "priority": null as it’s not supported as a filter via the Curl command alone.

(system) closed #7

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.