Bootstrap FreeKB - ServiceNow - Create standard change ticket using REST API
ServiceNow - Create standard change ticket using REST API

Updated:   |  ServiceNow articles

This assumes you have generated an OAuth Bearer Token using the ServiceNow REST API.

In order to create a standard change ticket using the ServiceNow REST API, you will need to know the sys_id of the standard change template. This can be found in the ServiceNow web browser console by going to All > Change > All Templates, selecting the template > Copy URL, which should return something like this. In this example 253da990fc45c35cda5001befdc905013141 is the sys_id of the standard change ticket template.

https://acme.service-now.com/nav_to.do?uri=std_change_record_producer.do?sys_id=253da990fc45c35cda5001befdc905013141

 

Let's say you have the following in a file named my.json.

{
  "assignment_group": "my assignment group",
  "cmdb_ci": "my configuration item",
  "assigned_to": "John Doe",
  "short_description": "my short description",
  "description": "my long description",
  "start_date": "2025-04-01 00:00:00",
  "end_date": "2025-04-01 01:00:00"
}

 

Here is an example of how to create a standard change ticket using curl, replacing abc123 with your Bearer token.

curl \
--request POST \
--header "Authorization: Bearer abc123" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--url "https://acme.service-now.com/api/sn_chg_rest/change/standard/253da990fc45c35cda5001befdc905013141"
--data @my.json

 

By default, the state of the normal change ticket will be New. You probably will want to patch the change ticket to Scheduled, replacing 733e02ed3bf42698d4b5f1c5e4e45a7e with the sys_id value returned by the prior POST request.

curl \
--request PATCH \
--header "Authorization: Bearer abc123" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--url "https://acme.service-now.com/api/sn_chg_rest/change/standard/733e02ed3bf42698d4b5f1c5e4e45a7e"
--data '{ "state": "Scheduled" }'

 

Once Scheduled, you'll then probably want to update the change ticket to Implement.

curl \
--request PATCH \
--header "Authorization: Bearer abc123" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--url "https://acme.service-now.com/api/sn_chg_rest/change/standard/733e02ed3bf42698d4b5f1c5e4e45a7e"
--data '{ "state": "Implement" }'

 

Assuming the change ticket is approved, the change ticket state should then be Scheduled. Once the change has been completed, you'll next want to update the change ticket to Review.

curl \
--request PATCH \
--header "Authorization: Bearer abc123" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--url "https://acme.service-now.com/api/sn_chg_rest/change/standard/733e02ed3bf42698d4b5f1c5e4e45a7e"
--data '{ "state": "Review" }'

 

And finally to Closed.

curl \
--request PATCH \
--header "Authorization: Bearer abc123" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--url "https://acme.service-now.com/api/sn_chg_rest/change/standard/733e02ed3bf42698d4b5f1c5e4e45a7e"
--data '{ "state": "Closed" }'

 


 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 71f494 in the box below so that we can be sure you are a human.