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-26-2017 10:30 PM
Please try, if this works
template.print(gr.number + ": " + gr.getDisplayValue('cat_item') + ", Stage: " + gr.getDisplayValue('stage') + "<br />");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 10:41 PM
No luck.
which is giving all requested items list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 10:46 PM
check if this helps.
template.print("<p></p>Requested items:<br />");
var gr = new GlideRecord("sc_req_item");
gr.get("request", current.sys_id); // Hope you are running template on sc_request table
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + ", Stage: " + gr.stage.getDisplayValue() + "<br />");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 11:00 PM
I am calling the script from sla warning notification.
Thanks,
Y Anjaneyulu