Send approval email to user stored in variable on catalog / request item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2015 03:49 PM
I am currently testing a file share request system for our service catalog. As part of this, the user will select the file share that they require access to from a drop down list. All of the file shares are stored in a module in the CMDB and have approvers listed for each file share.
Once you select the share from the drop down list, a catalog client script does a lookup and populates a field called 'Approver' with the users name. (this is a reference field which looks up the value from the sys_user table)
What I need to do is automate an email directly from the workflow on the service catalog which will email the approver to seek approval for access to the file share.
Has anybody done anything similar lately and if so, how can you do this. If possible, I would rather put the value into the "To" field on the email rather than the cc or bcc field.
I have had a look on here but have not been able to do this. Anybody got any ideas if this is possible?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2015 07:07 PM
If the user is in a variable, you'll have to use an approval script in your Approval - User workflow activity to set the user.
answer = [];
answer.push(current.variables.uservariable.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 01:11 PM
Hi Brad,
Sorry for being so late in coming back but I have now tried this and unfortunately, it is not working for me.
If I hard code the email address such as below, it works perfect and sends the email for me. However, this was for testing only as I need to be able to automate the sending of these emails from the system based on the value in my approver variable.
answer = 'john.doe@yourcompany.com';
I have also tried the following with no joy:
answer = current.variables.approver.sys_id;
and
answer = current.variables.approver;
answer = current.variables.approver.email;
where "approver" is my variable which is a reference field against the User[sys_user] table.
Am I missing something obvious here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 01:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2015 07:37 AM
Anyone else got any ideas on what I am doing wrong here or even if this is possible?