- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2017 12:14 AM
Hi All,
I need to fetch requested item variable's value from requested item table via script.
From the above image, i need to access the value which i have marked.
Thanks & Regards,
Kaka Nayeem
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2017 12:57 AM
Hi Kaka,
The script will be something like below. Variable's value from RITM can be fetched always by object.variables.variable_name.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number', 'RITM0000013');
gr.addQuery('gr.variables.color_you_like', 'black');
gr.query();
if(gr.next())
{
//do your logic
}
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2017 12:57 AM
Hi Kaka,
The script will be something like below. Variable's value from RITM can be fetched always by object.variables.variable_name.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number', 'RITM0000013');
gr.addQuery('gr.variables.color_you_like', 'black');
gr.query();
if(gr.next())
{
//do your logic
}
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2017 10:27 PM
Hi Amlan,
Your code is working fine.
Thanks for Help
Regards,,
Kaka Nayeem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2019 03:35 AM
hi
am new to service now...please anyone tell me on which table do i have to add this code in business rule or what will be the logic in
if(gr.next())
{
//do your logic // inside this
}
as i have the similar requirement where am able to generate those fields on sc task form but am not able to fetch those values from ritm form ...please help me with this
thanks in advance!!