- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 06:21 PM
change management catalogue item request number need to display in the change record "Requests" tab. This Catalogue item is using work flow.
In the flow designer using with Actions "update record" we can achieve this one. Can you help me on how to achieve this one in work-flow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 09:19 PM
Hello @sureshp89882164
Please use activity "Run Script" after the point where you want to add change request.
In the script part of that activity add below 👇 code -
// Get the Catalog Request (sc_request) record linked to this item
var req = new GlideRecord('sc_request');
if (req.get(current.request)) { // Ensure we have a valid request
req.parent = current.variables.your_change_request_field; // Replace with the actual field storing Change Request
req.update();
}
Modify it to reflect your change request number field name.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 09:43 PM
in your workflow run script of catalog item simply use this line
Is that change number a reference variable?
var chg = current.variables.changeVariableName.getRefRecord(); // give variable name here
chg.parent = current.getUniqueValue();
chg.update();
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
03-25-2025 10:39 PM
Hi @sureshp89882164 ,
Add a run script activity in the workflow with below script
var requestGr = current.request.getRefRecord();
requestGr.parent = current.variables.Change_Variable_Name;/*replace this ->Change_Variable_Name with actual variable name*/
requestGr.update();
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 11:18 PM
Hi @sureshp89882164 ,
you can update the same run script in the workflow
var requestGr = current.request.getRefRecord();
requestGr.parent = current.variables.Change_Variable_Name;/*replace this ->Change_Variable_Name with actual variable name*/
requestGr.short_description = current.cat_item.short_description;
requestGr.update();
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 08:34 PM
Hello @sureshp89882164
How are you getting rhe change request number to update it ? Is changed request being created by this catalog item ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 09:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 09:19 PM
Hello @sureshp89882164
Please use activity "Run Script" after the point where you want to add change request.
In the script part of that activity add below 👇 code -
// Get the Catalog Request (sc_request) record linked to this item
var req = new GlideRecord('sc_request');
if (req.get(current.request)) { // Ensure we have a valid request
req.parent = current.variables.your_change_request_field; // Replace with the actual field storing Change Request
req.update();
}
Modify it to reflect your change request number field name.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 09:43 PM
in your workflow run script of catalog item simply use this line
Is that change number a reference variable?
var chg = current.variables.changeVariableName.getRefRecord(); // give variable name here
chg.parent = current.getUniqueValue();
chg.update();
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