Creating a Change Management Request with REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2020 09:39 AM
I’m working on a project to try and automate some release tasks within my team. The end goal is to be able to fully create a ServiceNow Change Request via a third party application.
Currently ServiceNow’s REST API functionality allows users to create a Standard Change Request based on a template, however does not let the user change these fields:
- Description
- Backout plan
- Test plan
- Implementation plan
(https://developer.servicenow.com/app.do#!/rest_api_doc?v=newyork&id=c_change-management-api)
Which almost always vary from request to request. I can’t understand why these fields cannot be modified from the original template when creating the Change Request via REST. Is there any method of being able to modify these fields - either during or after the creation process from REST or any other API protocol.
- 14,487 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2020 02:48 PM
Hi Harry,
If you're running into issues using the regular Table API, you may want to consider creating a Scripted REST API via System Web Services -> Scripted Web Services -> Scripted REST API.
Here you can create your own custom endpoint and processing script that can parse your Request Body and create a Change Request using GlideRecord.
See the below link for some example scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2020 11:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2020 05:24 PM
Hi John,
Harry's question was specifically related to creating Standard Changes from a template, the fields listed as being unable to be modified by the API are the same fields that cannot be modified when creating a Standard Change normally, as the template should hold these values and they should not change unless the template itself changes.
That being said, looking at the /sn_chg_rest/change/standard endpoint it does not seem to mention those same fields as being off-limits for a PATCH http request, so you could potentially create a Standard Change using the POST method (which will then return the sys_id of your new change) and plug that sys_id into a subsequent PATCH request, to update those fields you require.
All this is coming from the below doco