
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 11:40 AM
Hello!
I'm trying to setup a sc task so it will assign the assigned to to a person from a reference field. IE it_owner (which is a reference field for sys_user)
I have tried the following with no luck and have referenced both :
The code I am using in the sc_task is:
task.assigned_to = current.variables.it_sponsor
Any clue what i'm missing?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 11:59 AM
Ok. In the case where it_sponsor is the name of the reference variable then your original code should work. Either of the following should assign the task to the person listed in the it_owner variable.
task.assigned_to = current.variables.it_owner;
task.assigned_to = current.variable_pool.it_owner;
If neither of those work, I would add some logging into your task script. Something like:
gs.log('IT Owner is: ' + current.variables.it_owner);
task.assigned_to = current.variables.it_owner;
You can then check the script log statements and see if the value is blank or maybe the wrong sysid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 11:59 AM
Ok. In the case where it_sponsor is the name of the reference variable then your original code should work. Either of the following should assign the task to the person listed in the it_owner variable.
task.assigned_to = current.variables.it_owner;
task.assigned_to = current.variable_pool.it_owner;
If neither of those work, I would add some logging into your task script. Something like:
gs.log('IT Owner is: ' + current.variables.it_owner);
task.assigned_to = current.variables.it_owner;
You can then check the script log statements and see if the value is blank or maybe the wrong sysid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 06:26 AM
Thanks yet again Brad! It is working as intended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2014 08:28 PM
Hi Brad
I a similar problem.
I have a catalog item called ABC Services. This item has a variable named v_requested_for. I want to assign this variable to task table field named 'requested_for'.
The workflow associated with catalog item assigns assignment_group to tasks outside the script and that works fine. Here is what I did in the workflow associated with this item.
gs.log('v_requested_for is: ' + current.variables.v_requested_for);
Option 1: task.requested_for = current.variables.v_requested_for;
Option 2: task.requested_for = 'My Name';
The log script shows sys_id of the user selected when this catalog item is requested. However, the field does not get assigned either using option 1 or option 2. Any help is appreciated.