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 set the Requested for value in RITM to within the RITM variables Requestes for (custom )

Kishore Thippal
Tera Expert

I have a requirement that inbound email action when email received by instance then need to create a RITM with SC TASK in fields we have requested for that value need to set the variables so have variables requested for (u_requested_for) this value I'm setting through flow designer but its not getting populate . in workflow i have used as run script activity in starting stage its not worked and have used business rule that's also not worked how to archive this feet.

 

i have used script BR

 

current.request.requested_for=current.variables.u_requested_for; // this not working

 

In workflow i have used this in first activity

workflow.scratchpad.requested = current.request.requested_for.getDisplayValue();

 

I have used this after approval activity in workflow in logs I'm getting the value but value haven't set for variable

current.variables.u_requested_for = workflow.scratchpad.requested;

 

KishoreThippal_0-1704176293393.png

 

 

Thanks,

Kishore.

 

 

 

 

1 ACCEPTED SOLUTION

Kishore Thippal
Tera Expert
Finally got the solution for this issue thank you Ankur Bawiskar
 
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.sys_id);
ritm.variables.u_requested_for = ritm.request.requested_for;
ritm.update();
gs.log('scratchpad:' + ritm.requested_for + ':' + current.variables.u_requested_for);
 
Thanks,
Kishore.

View solution in original post

6 REPLIES 6

Kishore Thippal
Tera Expert

I have used this script also in after BR 

current.variables.u_requested_for = current.request.requested_for.getDisplayValue();
 
I'm getting values in logs but it's not setting for the variable

Kishore Thippal
Tera Expert
Finally got the solution for this issue thank you Ankur Bawiskar
 
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.sys_id);
ritm.variables.u_requested_for = ritm.request.requested_for;
ritm.update();
gs.log('scratchpad:' + ritm.requested_for + ':' + current.variables.u_requested_for);
 
Thanks,
Kishore.