How do I update value of a Variable on an active RITM/Stask?

Kshitij Chakarv
Tera Contributor

Hi All, 

 

I have been trying of update variable value on an active RITM. So far I have tried these two script.

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id','eec9cfc287234d502d2d33b40cbb35b5');
gr.query;

if(gr.next()){
gr.variables.is_extension_on_access_needed = 'yes';
gr.update();
}
 
 
And 
 
var gr = GlideRecord('sc_item_option_mtom');
gr.addQuery('request_item', 'RITM0010056');
gr.addQuery('sc_item_option.item_option_new=685495a21b53415054eca752b24bcb25');
gr.Query();

if(gr.next()){
gr.sc_item_option.item_option_new.value == 'No';
gr.Update();
}
 
 
I am not sure what am i doing wrong and need an expert's eyes.
 
 
685495a21b53415054eca752b24bcb25 = Sys id of variable
eec9cfc287234d502d2d33b40cbb35b5 = Sys id of RITM record.

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this should work provided is_extension_on_access_needed is not within MRVS

Are you sure the value you are giving is correct?

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id','eec9cfc287234d502d2d33b40cbb35b5');
gr.query();
if(gr.next()){
    gr.variables.is_extension_on_access_needed = 'yes';
    gr.update();
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this should work provided is_extension_on_access_needed is not within MRVS

Are you sure the value you are giving is correct?

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id','eec9cfc287234d502d2d33b40cbb35b5');
gr.query();
if(gr.next()){
    gr.variables.is_extension_on_access_needed = 'yes';
    gr.update();
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, yes, is_extension_on_access_needed is not with in multirow VS. 

 

 

What I am trying to achieve is take user's response from mail and write a inbound action and update is_extension_on_access_needed (yes/No). if answer is 'No' workflow will come out of loop and creates a Task for fulfiller group. if users' response is 'yes' inbound bound script should update the RITM and workflows remains in loop till timer reaches next 'extension end date'. 

 

 

Kshitij Chakarv
Tera Contributor

Hi Ankur, I have been using incorrect syntax, I fixed it and got it to work. I overlooked in line 3. 

Thank you for your help 🙂

 

@Kshitij Chakarvarty 

Correct

Glad to know.

Please close the thread by marking appropriate response as correct.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader