Raising Standard change via rest api with dynamic data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 03:52 AM
Morning all
I'm working on an integration to raise standard changes from my company instance to a customers servicenow instance. Basically the goal is to trigger their standard change workflow while populating the record created in the customer environment with the data from my change request.
So I have created a standard change template in the customers environment. This template doesn't have much information on by design because I want the data sent across from my environment to populate the change record created in the customers record.
I then created the rest api end point /api/sn_sc/servicecatalog/items/32e5f2d01bbf1910d978eb53b24bcb24/submit_producer in my environment
So I'm able to now create the standard change in the customers environment but it applies the template data on creation rather than accepting the data from the change record in my environment, which makes perfect sense.
I'm trying to figure out a solution to this so the standard change process triggered but with the data I send from my change record. Any help would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 07:44 AM
HI CandyDee,
Hope you are doing great.
To raise a standard change in ServiceNow via the REST API, you would need to use the /change_request
endpoints of the API. These endpoints allow you to create, update, and query change requests in ServiceNow.
Here is an example of how you can raise a standard change using the /change_request
endpoints with dynamic data:
-
First, you would need to authenticate to the ServiceNow instance and obtain an access token. This token will be used to authenticate subsequent requests to the API.
-
Next, you would need to create a JSON object containing the details of the standard change you want to raise. This JSON object should include the fields required for a standard change, such as the change type, the reason for the change, and any relevant impact or urgency information.
-
Once you have constructed the JSON object, you can use the
/change_request
endpoints to create a new change request. You can do this by making aPOST
request to the/change_request
endpoint, passing the JSON object as the request body. -
If the request is successful, ServiceNow will return a response containing the details of the newly-created change request. You can then use the
/change_request
endpoints to query or update the change request as needed.
It is important to note that the specific details of how to use the /change_request
endpoints may vary depending on the version of ServiceNow you are using and the configuration of your instance. You should consult the ServiceNow documentation for more information on using the REST API to raise a standard change.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi