how to change the status of sc_req item dynamically in workflow ?

1dusjhyahnt
Tera Contributor

With the help of scripting i want to change the status of sc_req item dynamically with the help of scripting in workflow  , anyone help me

 

Set Value is not working in workflow 

7 REPLIES 7

Sandeep Rajput
Tera Patron
Tera Patron

@1dusjhyahnt Can you share the script which you have tried?

var ritmGR = new GlideRecord("sc_req");
ritmGR.get(current.sys_id);
gr.initialize();
current.state= 6;
gr.insert();

Jagadish Sanadi
Kilo Sage

var wr = GlideRecord('sc_req_item');

wr.addQuery('write_your_query');

wr.query();

while(wr.next())

{

wr.state = '1';

wr.update();

 

 

}

Please write your code as per your requirement

i only want my request status is resolved how we will get this ??