- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 11:12 AM
var ci = current.variables.cmdb_ci.getDisplayValue();
gs.log('CI' + ci);
if(ci)
{
var techSupport = ci.support_group;
gs.log('This is the support group' + techSupport);
task.assignment_group = techSupport;
}
else {
task.assignment_group = '9d7cbca24fb271007a990f5e9310c7e9';
}
I'm missing something fairly easy here, in the above code, my variable "techSupport" is always undefined. I'm using this script in the workflow activity to assign the task to a group based on the ci's support group(field named support_group on the ci form) if a ci is selected or assign to a defined group if its empty. The second part works. I cannot seem to get the value of the support group field for the ci on the item. I've tried getDisplayValue() with no luck.
Appreciate your help!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 11:24 AM
Try this
- if(current.variables.cmdb_ci)
- {
- gs.log('This is the support group' + current.variables.cmdb_ci.support_group);
- task.assignment_group = current.variables.cmdb_ci.support_group;
- }
- else {
- task.assignment_group = '9d7cbca24fb271007a990f5e9310c7e9';
- }
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2017 11:59 AM
Ok, thanks guys!