- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 03:52 AM - edited 07-04-2025 03:53 AM
For my particular catalog item, i want to make the changes so that once the RITM is raised then all the selcted variable along with their value should be auto populated in RITM description field as mentioned in the below screenshot.
Please provide the script for the same.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 04:23 AM
you can use Workflow run script or after insert business rule on RITM table
var arr = [];
var variables = current.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if (label != '' && value != '') {
arr.push(label + ":" + value);
}
}
current.description = arr.join('\n');
current.update(); // use this if you are using after insert BR, don't use this when workflow run script is used
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
07-04-2025 03:58 AM
Use below script:
Assuming current record as RITM record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 04:02 AM
Is this a BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 04:05 AM
you can use it in Insert BR/Workflows/Flows to accomplish your requirement @VIKAS MISHRA
Please mark correct if it is working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2025 04:23 AM
you can use Workflow run script or after insert business rule on RITM table
var arr = [];
var variables = current.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if (label != '' && value != '') {
arr.push(label + ":" + value);
}
}
current.description = arr.join('\n');
current.update(); // use this if you are using after insert BR, don't use this when workflow run script is used
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