REST API to get the incidents/problems assigned to specific user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 05:43 AM
Hi,
I am integrating ServiceNow in Node.js application. I want to know the REST API for getting all incidents/problems -
1. Assigned to specific user
2. Incidents/Problems with specific status/priority
Thanks & Regards,
Mitalee Jadhav
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 05:49 AM
you can use sysparm_query here and build the condition like below
sysparm_query=assigned_to=<user id>
same way you can get for incident/problem details , just add the filter in sysparm_query
https://developer.servicenow.com/app.do#!/rest_api_doc?v=madrid&id=c_AggregateAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 05:55 AM
Hi Mitalee,
you can use out of the box table API to get the details
sample request here
HTTP Method: GET
Endpoint for Incident: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=assigned_to.name%3DMitalee%20Jadhav
Endpoint for Problem: https://instanceName.service-now.com/api/now/table/problem?sysparm_query=assigned_to.name%3DMitalee%20Jadhav
Endpoint for Incident to get incidents with status as Active i.e. state as 2: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=state%3D2
Endpoint for Problem to get problems with status as Active i.e. state as 2: https://instanceName.service-now.com/api/now/table/problem?sysparm_query=state%3D2
Similarly you can use column as priority and get the records
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 06:39 AM
Thanks @Ankur Bawiskar for your quick and upto the mark response.
Will you help me know the mapping of the state to the numbers that you have mentioned. Also same for priority too. Is it document anywhere? If yes, please share the link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 07:34 AM
Hi Mitalee,
to know the choice value for state and priority
right click the state field and configure choices and it will show the choice values
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader