
- 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-22-2014 11:50 AM
In the description of your question you mention it_owner and in your code you reference it_sponsor.
If it_sponsor is a reference variable referencing the user table on your item, then your code should work.
If you want to copy from a field on the requested item called it_owner you would use task.assigned_to = current.it_owner.
Are you trying to assign the task to someone who is in a reference field or a reference variable?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 10:54 AM
Hi Brad,
Thanks for your support so far! I'm trying to assign someone who is already populated on the reference table. IE they choose the person from the sys_users, workflow moves forward, and the catalog task pulls that referenced person and sets them as the assigned_to

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 11:01 AM
When you say "they choose the person from the sys_users", who is making that choice and are they doing it in a field on a task or requested item or in a variable?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2014 11:53 AM
The person requesting is they. But the it_sponsor is referencing the sys_user table and I'm looking to have whatever value that is chosen on that variable be the requested to on the catalog task.
So the user fills out a form, and the it_sponsor is a reference field to the sys_user table. One of the catalog tasks I have from the workflow will need it's assigned_to field be the person listed as the it sponsor. (which may or may not be the requestor,) I wouldn't mind knowing how to do it either way in case for knowledge.