- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 12:02 AM
Hi All,
I have a requirement to create a Standard Change Request when the "Create change request" button is clicked from a form with a specific Standard change template. Please help me here. Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:35 AM
try this
// Get the standard change template (producer version) record
var stdChange = new GlideRecord('std_change_producer_version');
if (stdChange.get('<sys_id_of_standard_change_producer_version>')) {
var chg = new GlideRecord('change_request');
chg.initialize();
chg.chg_model = stdChange.chg_model;
chg.type = 'standard';
chg.requested_by = '<sys_id_of_default_user>';
chg.std_change_producer_version = stdChange.sys_id;
chg.short_description = stdChange.short_description; // Manually set
chg.assignment_group = stdChange.assignment_group; // Manually set
chg.service = stdChange.service; // Manually set
chg.service_offering = stdChange.service_offering; // Manually set
// Set other fields as needed
var chg_id = chg.insert();
}
also check this link - response from GBall
Apply Standard Template for Change Request through Script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 12:23 AM
UI action should be on which form? share screenshots
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:18 AM
Hi @Ankur Bawiskar ,
Thank you for the reply. The UI action should be on CISCO form, so when user click on Create change request, the standard change request should get automatically created by populating the values from the existing standard template they have created.
So I have written the below script, now the Standard CR is getting created but short description, assignment group, service and service offering field values are not getting populated. Only Description, Implementation and Backout plan is getting copied from that template.
Script:
Please help me here, as why the Short desc, Assignment grp, Service and service offering are not getting populated.
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 03:35 AM
try this
// Get the standard change template (producer version) record
var stdChange = new GlideRecord('std_change_producer_version');
if (stdChange.get('<sys_id_of_standard_change_producer_version>')) {
var chg = new GlideRecord('change_request');
chg.initialize();
chg.chg_model = stdChange.chg_model;
chg.type = 'standard';
chg.requested_by = '<sys_id_of_default_user>';
chg.std_change_producer_version = stdChange.sys_id;
chg.short_description = stdChange.short_description; // Manually set
chg.assignment_group = stdChange.assignment_group; // Manually set
chg.service = stdChange.service; // Manually set
chg.service_offering = stdChange.service_offering; // Manually set
// Set other fields as needed
var chg_id = chg.insert();
}
also check this link - response from GBall
Apply Standard Template for Change Request through Script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 07:34 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader