Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Use REST API to Create Standard Change Request from Template and Set Fields

brenthubin
Tera Contributor

I am needing to create a Standard Change Request using an approved template and also be able to set some fields that are dynamic (such as the company and configuration_item fields). I'm able to create the Standard Change Request using the Service Catalog submit_producer API, but for some reason when I pass variables to it for any field it does not fill that field in.

I've tried this using the REST API Explorer with no success using the sn_sc namespace and OOB Service Catalog API and the Submit a Record Producer method. Screenshots of this are below. Note that I have indeed already tried specifying the sys_id for the reference fields. That isn't the problem.

Thank you for any assistance you can offer.

find_real_file.png

find_real_file.png

7 REPLIES 7

aaelgani
Tera Contributor

I am not sure if this is still a question, but you can use different name space sn_chg_rest, it has APIs to post changes using standard or normal change tmeplates and also set fields.

I'm not sure I understand your post.  I looked for a table by that name and couldn't find anything.  Do you have more detail or a link to more detail?

In the REST API Explorer instead of using sn_sc (in your screenshot) use the sn_chg_rest as the Namespace.

DavidWhaley_1-1678738935546.png