Gtt Reqested Item varible onto Catalog tasks in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello,
Thank you in advance for looking into the post and helping.
I'm trying to get requested item's Assignment group to catalog task assignment group in the workflow activity.
This code is present in the script section of the workflow.
I'm unable to get the selected assignment group on Req item to catalog task's assignment grup
I have attached a pic of the workflow activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
38m ago
The workflow is likely running on the sc_req_item table, 'current' refers to the the RITM. Use current.field_name to access fields on the sc_req_item table, and current.variables.variable_name to access Catalog Item variables.
So your script would look more like this, depending on knowing the distinction between fields and variables, using the correct names for both in your instance, and logic - setting the value to that of a field after checking that a variable with the same name is not empty doesn't make any sense:
// Set Assignment Group
if (!gs.nil(current.variables.assignment_group)) {
task.assignment_group = current.assignment_group;
} else {
// task.assignment_group = "e662aaa847b07190f726ba67436d43de"; // sys_id of Service Desk group recommended
}
// Set Assigned To
if (!gs.nil(current.variables.manager)) {
task.assigned_to = current.manager; //not an out of box field, check the name
}
