- 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-18-2019 05:04 AM
Hi Manjunath,
I didn't really understand your question. If you need to get the requested for email, you can just dot-walk like this:
var temp = current.requested_for.email; (if you are in a BR on Request table).
Or current.variables.requested_for.email if it is a variable of a form.
Let me know if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 11:34 AM
Hi edoardo.c,
My question is, When i click on order now in 'Service Portal' page with my own 'Service catalog' items (below screenshot),
It will show popup with 'Request For' option (screenshot attched in my previous question), where we need to select the user, Then this request will create on behalf this selected user.
So, I need to get the Email id of that request for selected user in my business rule (script) .
(Note: These script
var temp = current.requested_for.email; Or current.variables.requested_for.email;
didn't work)
Please help me to resolve this issue.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 12:04 PM
Try the accepted answer from this link and check once.
Mark the comment as a correct answer and also helpful if it helps.
- 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