- 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 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-04-2023 12:15 AM
Hi @abc1233
Then you can use a background script for this:
var ritms = new GlideRecord('sc_req_item');
ritms.addQuery('request.description', '');
ritms.query();
while (ritms.next()){
var requestRecord = GlideRecord('sc_request');
if (requestRecord.get(ritms.getValue('request'))){
requestRecord.setValue('description', current.getValue('description'));
requestRecord.update();
}
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.