API issue - POST /sn_chg_rest/change/standard/

Max B1
Kilo Explorer

Hello,

I am trying to create a change via API. This documentation looks relevant to that:

https://developer.servicenow.com/app.do#!/rest_api_doc?v=madrid&id=changemgmt-POST-std-create-chng-r...

And in this example I have replaced my instance name and a valid change template ID

curl "http://instance.service-now.com/api/sn_chg_rest/change/standard/92b8544047810200e90d87e8dee490b0?description=test&short_description=Reboot%20server&no_such_field=something" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'

This creates a change successfully, but all three parameters being passed in (description, short_description, and no_such_field) are all being added to the ignoredFields list. Not sure why, has anyone else faced this issue? I've tried other fields as well, and they're just not being passed in at all, even though the change is created. 

1 REPLY 1

Manish Vinayak1
Tera Guru

Hi Max,

 
Here is the documentation on the change management API:

 

NameDescription
versionOptional. Version of the endpoint to access. For example, "v1" or "v2". Only specify this value to use an endpoint version other than the "latest".
standard_change_template_idUnique identifier of the standard change template on which to base the new standard change request (from [std_change_record_producer] table).
name-value pairsFields within the specified standard change template to modify when creating the request. The key is the field name within the template and the value is the information to populate in the field.

Fields that cannot be modified and are ignored if passed in:

- Description

- Backout plan

- Test plan

- Implementation plan

- read-only fields as defined in ACLs

- fields that do not exist in the specified standard change template

 

If you look at the name-value pairs parameter's description, you will see that there are fields which cannot be modified and are ignored. Description is one of them. And it also says if the field you are passing doesn't exist in the specified standard change template, it is going to be ignored.

See if all the fields you are passing are part of your template, if not, try passing fields which are specified in your standard change template.

Hope this helps!

Cheers,

Manish