- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 06:49 AM
Hi Team,
When revieiwing the list of active REQ tickets, the Description field is empty.
This needs to be populated based on what was input by the user, taking the information from Description field of the associated RITM ticket.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 08:29 PM
then use background script to update those REQ
something like this
updateRecords();
function updateRecords(){
try{
var req = new GlideRecord('sc_request');
req.addEncodedQuery('descriptionISEMPTY');
req.query();
while(req.next()){
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request', req.getUniqueValue());
ritm.query();
if(ritm.next()){
req.description = ritm.description;
req.update();
}
}
}
catch(ex){
gs.info(ex);
}
}
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
‎10-03-2023 06:56 AM
Please use Business Rule
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sc = new GlideRecord('sc_req_item');
sc.addQuery('sys_id', current.request_item);
sc.query();
while(sc.next()) {
current.short_description = sc.short_description;
current.update();
}
})(current, previous);
https://www.servicenow.com/community/itsm-forum/copy-ritm-description-to-request-and-task/m-p/884900
Regards
Suman P.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 06:57 AM
Hi @abc1233,
There are multiple ways to do that, easiest is probably to use a Business rule which is triggered on the insert of a RITM.
var requestRecord = GlideRecord('sc_request');
if (requestRecord.get(current.request.sys_id)){
requestRecord.setValue('description', current.description);
requestRecord.update();
}
But keep in mind that Request can potentially have multiple RITMs associated to them.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 07:04 AM
what happens when REQ have multiple RITMs belonging to different catalog items?
you can use workflow run script for this if this is required only for 1 catalog item
var req = current.request.getRefRecord();
req.description = current.description;
req.update();
OR
you can also use flow designer Update Record action if you are using flow only for 1 catalog item
OR
you can use after Insert BR on RITM if you want to do this for all catalog items
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
‎10-03-2023 10:26 AM - edited ‎10-03-2023 10:28 AM
Hi @Ankur Bawiskar / @Peter Bodelier ,
Thanks for your response, but I want While reviewing the list of active REQ tickets, the Description field to be updated (Description should be same as description of RITM)