Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to update Requested for and Opened by on sc_req_item table

Ram050670
Tera Guru

Hi All,

how to update Requested for and Opened by on sc_req_item table in workflow of a catalog item

var requestedFor = current.varaibles.req_for;

var openedby = current.opened_by;

above are the values from current RITM and need to update on the new RITM after this request

 

var reqItem = new GlideRecord('sc_req_item');
reqItem.get(sys_id);
reqItem.requested_for = requestedFor;
reqItem.opened_by = openedby;
reqItem.update();

 

i am trying to use this but not able to update the record.

 

 

 

11 REPLIES 11

not working 

Naneen_0-1698777604166.png

 

 

but i tried this  and got like this except Opened by

Naneen_1-1698777728039.png

 
 

Naneen_4-1698777813287.png

 

Hi @Ram050670 ,

 

Ok can u try updating opened by without task like

reqRecord.opened_by = openedby;

 

Thanks,

Danish