'Getting Change Management records with Service Now API

I am having the change management number CH****12. I want to get the records for this change management number in ServiceNow API.

For example, I had incident number and got the records with incident number INC*****12 through accessing https://instance.service-now.com/incident.do?SOAP service url and appropriate credentials(username and password) with getRecords.

Similarly, I want to get records for the given change management number.



Solution 1:[1]

Consider using the ServiceNow REST Table API for this type of request. Using the REST table API the URL for a specific Change Request would be: https://{instance_name}.service-now.com/api/now/table/change_request/{sys_id}

Where sys_id is the id of the Change Request you want to retrieve.

For Example: https://{instance_name}.service-now.com/api/now/table/change_request/a9e9c33dc61122760072455df62663d2.

If you are using ServiceNow Fuji Release you can use the REST API Explorer to help you build and test these requests.

Hope that helps.

Solution 2:[2]

https://instance.service-now.com/change_request.do?JSONv2=&sysparm_action=getRecords&sysparm_query=number=CHG000001

The above query should work. Change instance.service-now.com to your service now DNS name.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bryan
Solution 2 user229044