- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 12:31 PM
I am trying to send a simple notification at the end of a workflow to the individual set as the assigned to on the catalog task, however, it does not appear to be sending out. Hoping someone can point me in the right direction. The script I currently have is:
// Set the variable 'answer' to a comma-separated list of user or group sys_ids that you want the email sent to.
answer = current.assigned_to;
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 01:21 PM
If you have only one task on the RITM you could try it this way, or adapt it to your needs.
Code:
var gr = new GlideRecord("sc_task");
gr.get("request_item",current.sys_id);
answer = gr.assigned_to;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 12:49 PM
My guess is that the workflow runs on sc_req_item level and not on sc_task level. If you are trying to send the notification to sc_task.assigned_to, you would need to create a script to find the last updated sc_task for this Requested Item.
If the workflow is at sc_task level, then why are you making it more difficult? The notification activity allows you to select the field from the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 12:51 PM
Hi Marc
If you have this as an activity in workflow, current.assigned_to will be empty by default as it looks for assigned_to on RITM table.
But, you said you want to send the email to the individual set as the assigned to on the catalog task, so you can create notification on sc_task table to send out after closing that particular task and send it to the Assigned To of the task.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 01:04 PM
Only create an event from the workflow. And from this event trigger your notifications.
Trust me, it would be so much pain when it comes to debugging or updating WF notifications.
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2019 01:21 PM