- 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-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-22-2020 12:52 AM
Thanks Danny. your suggestion is helped me to achieve my goal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 12:54 AM
NP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 01:06 AM
Hi
You can build your REST Query more easily by going to System Web Services > REST > REST API Explorer
and end your end point with condition state is open or pending look like
https://dev93456.service-now.com/api/now/table/sc_task?sysparm_query=state%3D1%5EORstate%3D-5&sysparm_fields=number%2Cstate&sysparm_limit=1
Mark ✅ Correct if my answer solves your issue and also mark 👍 Helpful if you find my response worthy.
Thanks & Regards
Himanshu Dubey