Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 09:14 AM
Hi All,
I using the script to add variables and variable task in sc_task page but only variale are visible. Variable set is not visibleon sc_task page.
Can anyone help me on this ?
var gr = new GlideRecord('sc_item_option_mtom');
gr.addQuery('request_item', current.sys_id);
gr.query();
while (gr.next()) {
var getVar = new GlideRecord('item_option_new');
//getVar.addQuery('cat_item=' + current.cat_item);
getVar.addEncodedQuery('cat_item=159d51eddb6f21108f50e6650596190b^name!=required_number_of_tasks^ORname=NULL');
getVar.query();
//For each variable, create an associated record in sc_item_variables_task
while (getVar.next()) {
setVar = new GlideRecord('sc_item_variables_task');
setVar.initialize();
setVar.task = task_sys_id;
setVar.variable = getVar.getValue('sys_id');
setVar.update();
}
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 09:33 AM
try this
https://snprotips.com/useful-scripts#12
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 09:33 AM
try this
https://snprotips.com/useful-scripts#12
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader