Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get Request for (selected user) email id ?

Manjunath6
Kilo Contributor

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)

find_real_file.png

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.

1 ACCEPTED SOLUTION

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

View solution in original post

5 REPLIES 5

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