- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 01:18 PM
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();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 03:31 PM
Given script in workflow should work fine. but you can try the following code in your workflow script.
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.requested_for.setDisplayValue(current.variables.u_who_is_asking_for_this_to_be_completed);
sr.update();
}
1. You should also reverify the Column Name(backend) for Requested for on the Request.
2. Verify that there is no Client script or BR that is clearing the Requested for field for REQ.
Regards,
Ashir Waheed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 03:31 PM
Given script in workflow should work fine. but you can try the following code in your workflow script.
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.requested_for.setDisplayValue(current.variables.u_who_is_asking_for_this_to_be_completed);
sr.update();
}
1. You should also reverify the Column Name(backend) for Requested for on the Request.
2. Verify that there is no Client script or BR that is clearing the Requested for field for REQ.
Regards,
Ashir Waheed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 01:48 PM
I found a BR that was causing the issue. Once I fixed that, I was able to use the script.
Thanks!