Set the "requested for" on an RITM from a variable

Mark Weitzel1
Mega Expert

I've seen this posted as a solution, but I can not get it to work. We allow someone to open a request on behalf of someone. The variable for that field on the catalog item is u_who_is_asking_for_this_to_be_completed.  I added a "run script" to the workflow right after the "begin". But the issue is, it is setting the "requested by" field of the RITM, not the Requested for field.

 

We are running San Diego. 

 

I am not sure what I am doing wrong. 

 

Any help is appreciated. The code from the script is:

 

 

var sr = new GlideRecord('sc_request');

if(sr.get(current.request)){ sr.setValue('requested_for',current.variables.u_who_is_asking_for_this_to_be_completed); 

sr.update();

}