REST API to get the incidents/problems assigned to specific user

Mitalee
Kilo Contributor

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

5 REPLIES 5

Harsh Vardhan
Giga Patron

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

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader