I have a Catalog Task in my workflow. I'd like to set this tasks 'assigned_to' field, equal to the Request Items 'opened_by' user.
Here is what I am currently trying, without luck. Any thoughts are appreciated:
var req = new GlideRecord('sc_req_item');//look at the Request Item req.addQuery('parent',current.sys_id); req.query(); task.assigned_to = req.opened_by;//take the assigned to and set it to the Request Item's 'opened_by' field
Thanks!
That works well. Now I suppose I should also set the assignment group to match the 'opened_by' users assignment group. I tried this, but it's not quite working:
task.assignment_group = current.assignment_group;
That line of code would work
That line of code would work if the request item record has an assignment group filled in. If you're looking to get a default assignment group you'll need to query for that somehow. ServiceNow doesn't include the concept of a default assignment group, so if you do have that concept, it's likely specific to your setup.
Contact Us to discuss how we can help make your ServiceNow project a success!
If the task is being
If the task is being generated from a workflow running on the request item table you should just be able to do this...
task.assigned_to = current.opened_by;
Contact Us to discuss how we can help make your ServiceNow project a success!