Pulling Catalog Task values from Request Items in Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2011 09:34 AM
Hi Everyone,
I am trying to create a workflow notification for a Service Request. In the workflow for the Request Items table I create a Catalog Task. The Catalog Task is has an assignee and assignment group field that is different from the Request Item.
How would I script the notification so that:
1. It sends the notification to the assignee and assignment group of the task, not the request item
2. It includes the values of the assignee and assignment group of the task within the request item body?
I have tried a couple of things to add them to the body.
8. Assignment Group: ${sc_task.assignment_group}
8. Assignment Group: ${task.assignment_group}
I tried in a mailscript
template.print("8. Assignment Group: " + sc_task.assignment_group.getDisplayValue() + '\n');
And a couple of different variations there of. Am I on the right track or am I way off base?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2011 09:38 AM
I also tried creating a normal notification that is triggered by an event in the sc_task table using
if (current.operation() == 'insert') {
gs.eventQueue("sc_task.inserted", current, gs.getUserID(), gs.getUserName());
}
However, the notification was not sending out and I couldn't figure out why. That is why I opted to try sending out a notification through the workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2011 02:33 PM
I think this is the best way for you to go if what you're looking to do is send a notification to the assignment group or assigned to when a catalog task is assigned to them. There should actually be some notifications out of box called 'Email assigned to' and 'Email assigned to group' that email the person or group that a task is assigned to. You may want to take a look at those.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2011 12:49 PM
You are way off track. Normally a Requested Item has multiple catalog tasks. This is why you cannot reference "the task" from the request item workflow.
Try the following: Save a reference to "the task" in a variable attached to the requested item.
(1) Use Edit Catalog Variables to define a workflow variable named notification_group. The variable type is Reference and the Reference table is Group [sys_user_group].
(2) From within the Catalog Task advanced script, set the variable to the value of the task assignment group.
current.variables.notification_group = task.assignment_group;
(3) Now that you have the group saved in a variable, you can reference it elsewhere in the workflow. Create a notification and use the advanced script to send it to the group.
answer = current.variables.notification_group;
You can reference the group in the email body as ${variables.notification_group}.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2011 05:53 PM
Brad is right. Email notifications to task assignees at the time of task creation are out-of-box functionality. There is no reason to script them. My procedure is only useful if, for some bizarre reason, you were trying to send an additional email to the assignment group at a later point in time.