- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 10:06 AM
I am trying to create a standard change request record using script. But the change is getting created as a normal change.
var chg = new GlideRecord('change_request');
chg.initialize();
chg.type = "standard";
chg.std_change_producer_version = '16c2273c47010200e90d87e8dee49006'; // Sys ID of the Standard Change Templates version
chg.applyTemplate('Clear BGP sessions on a Cisco router');
chg.insert();
I am unable to set the model to standard. Please help me with this.
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 11:33 PM
Hi
In your First screenshot as well the Change Record got created successfully as shown in red below:
Model value is taken from below Table which is an OOB table and sys id which I have provided should remain same for you as well, but worth double checking it again.
Navigate to the Model table by typing "chg_model.LIST" in Application Navigator menu as shown below:
Now Right click on Standard and copy the sys id which you will need to use it in your script shared above:
Say if you do not see Standard in your Change Model table then you can import the attached XML record which is from a OOB ServiceNow PDI instance which will add your Standard Model and relevant states linked to this model.
Result:
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 09:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 09:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 11:33 PM
Hi
In your First screenshot as well the Change Record got created successfully as shown in red below:
Model value is taken from below Table which is an OOB table and sys id which I have provided should remain same for you as well, but worth double checking it again.
Navigate to the Model table by typing "chg_model.LIST" in Application Navigator menu as shown below:
Now Right click on Standard and copy the sys id which you will need to use it in your script shared above:
Say if you do not see Standard in your Change Model table then you can import the attached XML record which is from a OOB ServiceNow PDI instance which will add your Standard Model and relevant states linked to this model.
Result:
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 11:34 PM
Hi
Let me know if you are stuck and if your query is resolved then please mark my answer as correct and close this thread for others.
Regards,
Shloke
Regards,
Shloke