- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 04:11 AM
Hi Team,
I have a requirement to fetch all Open and Pending state tickets on single api call. I have an idea how to fetch both states on separate rest api call
for example to fetch open ticket we can the below mentioned url
"https://instance.service-now.com/api/now/v1/table/incident?state=1"
and for Pending state we can use the below url
"https://servionindev.service-now.com/api/now/v1/table/incident?state=-5"
So my concern is need to fetch both the states on single api call. Kindly help me get out this issue.
Regards,
Bala N
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 12:36 AM
Hi,
I think you can try this: https://instance.service-now.com/api/now/table/sc_task?sysparm_query=state=1^ORstate=-5.
Regards,
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 05:58 PM
Hi,
Could you want to make it like this "https://instance.service-now.com/api/now/v1/table/incident?state=1^ORstate=-5"?
Regards,
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 09:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 12:25 AM
Hi Denny,
I have tried with your approach but couldn't bring any record either Open or Pending state and I am getting error response like
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 12:27 AM
Team,
I've tried like this below as well but this returns all records means didn't consider my state condiiton.
https://instance.service-now.com/api/now/v1/table/task?sys_class_name=sc_task&state in (1,-5)