Alternative email addresses lookup on approvals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2018 11:36 AM
It's time I tackle this so I have a question. We have users with different email addresses (due to domain relationships). So when certain users attempt to approve a request, it'll reject them since their primary is not valid. I have a custom secondary email address field and just want to have ServiceNow check if the second email address matches.
I checked the inbound action called "Update Approval Request" and looking at this line:
function validUser() {
if (current.approver == email.from_sys_id)
return true;
Would it just be a simple addition of a condition or would I have to add a query?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 03:02 PM
Great. That worked. Though before I say this is the perfect solution, I noticed that the approval shows up as a guest and not the me, the user, in the approval activity.
Would I have to place another change in the inbound action for emails to figure out who the user is?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 03:26 PM
Hi kkim,
Please take a look at a blog I posted here a while back on handling multiple email addresses per user. It uses the built-in Notification Devices to track multiple addresses per user, and works by catching/updating the email record before it gets written to the table. So I think it should work on your Approval IEA without modifications, although I have not tested this.
It would solve your issue of updates getting recorded as by "guest".
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 04:04 PM
Hi Brian, I looked at this solution a few days ago and I don't know if it would be exactly what I'm looking for. I did try it out in a sub-prod instance. I already had the custom field filled in for the most users and I don't see an automatic method to do this. It's just the way that the organization prioritizes their addresses.
I may re-evaluate it at a later time.
I may have missed this but with our AD sync, would there be any issues?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 05:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 11:43 AM
I forgot to mention, I was getting cross scope errors trying your scripts. Where would I fix that? I checked the application scopes and seems to be ok. I'm currently on Jakarta.
Access to api 'setWorkflow' from scope 'x_application' has been refused due to the api's cross-scope access policy
Would I also be able to check if the script worked by looking at a device entry?