How can we get the requested item related to current request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 10:25 PM
How can we get the requested item related to current request?
I able to to get the requested items along with the current request item.
But I want to display the requested item related to current request.
I am using the below code.
template.print("<p></p>Requested items:<br />");
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request_item", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + ", Stage: " + gr.stage.getDisplayValue() + "<br />");
}
Regards,
Y Anjaneyulu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:58 AM
Yes Priya. I want to show all the RITM's which are related to the current request.
Thanks,
Y Anjaneyulu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 05:04 AM
Did u get my point..
Thanks,
Y Anjaneyulu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 05:08 AM
Hi Anji,
Yes I got your points. When I try from background script I could get the records (RITM's) that are associated with the Request.
Thanks,
Priyanka R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 08:57 AM
var gr = new GlideRecord("sc_req_item");
gr.addQuery('sys_id',current.task);
gr.query();
if(gr.next( ) )
{
//gs.log("My email script"+gr.number);
template.print(gr.number + ": " + gr.getDisplayValue('cat_item') + ", Stage: " + gr.stage + "<br />");
}
This is working !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 10:16 PM
Hi ,
Can you please tell me for which table you are witting the script?
Thanks,
Priyanka R