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 11:03 PM
I think, that should be fine as long as you are creating email template on sc_request table, then only current.sys_id will give you the sys_id of the Request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:09 AM
I am still getting the requested items list.
How can we stop the remaining items apart from the current item associated with the request.
Thanks,
Y Anjaneyulu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:36 AM
Hi Anji Yatham,
Good Day
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", 'current.sys_id'); /*you are GR the req item table with request */
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.getDisplayValue('cat_item') + 'Stage :'+ gr.stage); /*hope it gives you the values*/
}
Hope it will helps you out!
Thanks,
Priyanka R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:48 AM
Thanks Priya...But it is not working.
Still I am getting the all items.
Thanks,
Y Anjaneyulu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 03:53 AM
Hi Anji yatham,
I have a query for the clarification. You want to show all the RITM's which are related to the current request correct.
And also you have used the while which will returns you all the requested items that are related to REQ.
Can you please brief the need from your end?
Thanks,
Priyanka R