- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 03:53 AM
Hello All,
I have a catalog form. On the submission of this catalog form I have create a normal change request and assign values to it through script. Could you please someone guide me?
Thanks
Bala
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 04:15 AM
Hi Bala,
Sample script here
var gr = new GlideRecord('change_request');
gr.field1 = current.variables.<variableName1>;
gr.field2 = current.variables.<variableName2>;
... and so on
gr.insert();
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 03:58 AM
Hi Bala,
you can have either of these 2 approaches; are you taking values from catalog item and populating in change request
1) have workflow for this RITM; in that use run script activity and create change request by fetching values from variables using current.variables.<variableName>
2) have after insert business rule on sc_req_item table with condition as catalog item is yours and have script similar to workflow run script
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 04:11 AM
Thanks Ankur. I have all the catalog values and derived few more values needed for CR in my run script. But I am not sure how to create the CR from there on.
thanks
Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 04:15 AM
Hi Bala,
Sample script here
var gr = new GlideRecord('change_request');
gr.field1 = current.variables.<variableName1>;
gr.field2 = current.variables.<variableName2>;
... and so on
gr.insert();
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 03:22 AM
hi ankur,
Can you tell me the possible ways to create a change request
Thanks,
Shreshta