How to fetch data from sc_request table using RITM number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 04:43 AM
There is one scenario in my project where I am getting RITM number based on that I need to fetch

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 05:11 AM
You can try this below script. Please mark it correct if it fulfills the requirement
var item = new GlideRecord('sc_req_item');
item.addQuery('number','RITMNumber');
item.query();
if (item.next()){
var req = item.getValue('request');
}
var request = new GlideRecord('sc_request');
request.addQuery('sys_id',req);
request.query();
if (request.next()){
var req2 = item.getDisplayValue('short_description');
gs.info(req2);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 05:11 AM
Hi @Anuja Jadhav1,
Please find the below link it will help you to resolve your issue.
I hope this helps!
Regards,
Hemant
**Please mark my answer correct or helpful based on the impact**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 05:35 AM
where are you writing the script?
Sample script
var item = new GlideRecord('sc_req_item');
if(item.get('number','RITMNumber')){
var reqObj = item.request.getRefRecord();
var shortDescription = reqObj.Value('short_description');
gs.info(shortDescription);
}
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