- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 04:11 AM
Hi,
I'm trying to script who should get an email notification from the system, through workflow.
I've created a Notification activity like below:
Then i want to send an email to requested_for (reference to sys_user), requested_for is a variable so i've tried adding:
current.variables.requested_for
At the same time i want to send the same mail to the requested_for's manager. The manager is set in a seperate field, so i've tried using:
current.variables.manager.
Any idea on how to use this TO (Script) to make it work?
Best regards,
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Service Portal
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 05:33 AM
Solution: (where you can add answer.push for both user and manager):
answer = [];
answer.push(current.variables.manager.sys_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 04:24 AM
To (script) | If Advanced is selected, this script is called and should set the variable answer to a comma-separated list of user or group sys_ids that you want to add as recipients of the email. |
It should be something like:
answer=current.variables.VAR_NAME;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 04:31 AM
Hello Rody,
You can achieve this without scripting from the workflow notification activity using "dot-walking" method.
you can click on "select field " and use dot walking as follows:
1) Request--> Requested For
2) Request--> Requested For-->Manager
Regards,
Gaurav Talreja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2017 12:09 PM
Hi Guarav,
using the 'select fields' dot walking method doesn't seem to work for me. if i use a field from that the email doesn't fire at all. However if i enter a specific email address or select a specific user it does fire the email. Any idea why that could be? I'm working off the Catalog Task (sc_task) table. Does that make a difference?
thanks,
denise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2017 05:33 AM
Solution: (where you can add answer.push for both user and manager):
answer = [];
answer.push(current.variables.manager.sys_id);