- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:18 PM
HI,
I have a business rule in place on sc_task table and now I want to send the RITM Number that is present in TASK.
Currently i am using current.request_item.getDisplayValue(); But its not sending the RITM numebr instead its sending the TASK number.
Can anyone please help me.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:21 PM
Hello,
You need to do GlideRecord on sc_req_item table to get the RITM #. sample code like below should help you.
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.request_item);
gr.query();
if(gr.next())
{
current.u_request_number = gr.number;
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:21 PM
Hello,
You need to do GlideRecord on sc_req_item table to get the RITM #. sample code like below should help you.
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.request_item);
gr.query();
if(gr.next())
{
current.u_request_number = gr.number;
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:27 PM
HI,
yeah I did
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.request_item);
gr.query();
while(gr.next())
{ ritm_sys_id = gr.sys_id;
}
and then
var ga = current.request_item.getDisplayValue();
But i am not getting the RITM NUMBER.
i am getting the TASK NUMBER

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:31 PM
this is wrong ritm_sys_id = gr.sys_id; what is ritm_sys_id.
also, you can get the RITM number using number instead of sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 01:35 PM
so if i use like
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.request_item);
gr.query();
if(gr.next())
{
current.u_request_number = gr.number;
}
var ga = gr.number;
If i pass the number like this will it work.