Rest API query two incident number

Chong1
Kilo Contributor

Is that possible to query two incident number with below query ? or any available api to query two incident number ?

Incident management: https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sysparm_query=number=$TICKETID

2 REPLIES 2

Ravi Peddineni
Kilo Sage

Hi Chong,

You can use https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sysparm_query=numberIN$TICKETID1,$TICKETID2

You can put as many numbers comma(,) separated in the URL and call the REST API

 

Viraj Hudlikar
Giga Sage

Hi @Chong 

To query more than one incident number your URL will be 

https://InstanceID.service-now.com/api/now/table/incident?sysparm_query=active%3Dtrue%5Enumber%3DINC0010245%5EORnumber%3DINC0010244&sysparm_display_value=true&sysparm_fields=number%2Cshort_description%2Cdescription%2Cstate&sysparm_limit=10

or 

https://instanceID.service-now.com/api/now/table/incident?sysparm_query=active%3Dtrue%5EnumberININC0010245%2CINC0010244&sysparm_display_value=true&sysparm_fields=number%2Cdescription%2Cshort_description%2Cstate%2Csys_created_on%2Csys_created_by%2Csys_updated_by%2Csys_updated_on&sysparm_limit=10

 

If you want URL you can check rest api explorer module just specify table name and method as GET and in sysparam_query paste query which you can create from list view and right click on it and copy query and paste it here. in sysparm_fields you can mention fields which you need in response.

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.

Thanks & Regards,
Viraj Hudlikar.