- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2019 04:51 AM
Hi,
I need to get Request For (selected user) email id.
Ex:
I have logged in to developer instance as 'System Admin' and i will goto Service Portal > Service Catalog then i will click order now button, then in 'Request For' i will select some user (as shown in screenshot)
So, in studio business rule, How can i get request for user (Abel Tuter) Email address.
Note: I tried below script, but this gives me system admin email id not Request for user email id.
var myUserObject = gs.getUser();
gs.addInfoMessage('mail = '+myUserObject.getEmail());
Please help me to get Request for (selected user) user email id.
Thanks You.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2019 12:39 PM
This was close but the requested for var is not actually a var it is a field on the sc_request table. So the br would run on the ritm table and to access the value it would be.
current.request.requested_for.getDisplayValue() for the name or
current.request.requested_for.toString() for the sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2019 04:11 AM
Hi,
I replaced getDisplayValue with email (as mentioned below) in your above code, then i got user email id.
current.request.requested_for.email;
Thank you,
Manjunath