KBEC-00403 - Dynamically pass in user's email address

Summary

This article will describe how you can pass in a user's email by referencing it as a property.

Solution

If your system is set up with LDAP/AD to pass over the email information for your users or a local user with the email address field filled in, then you should be able to reference the user's email as follows $[/users//email] as shown in this example:

C:\Users\ecloud>ectool getUser test

   
      0058d8d7-5af5-11e8-bfc7-525400100b82
      test
      2018-05-18T23:41:35.368Z
      tester@electric-cloud.com
      tester
      ecloud
      2018-05-18T23:41:35.368Z
      1
      ecloud
      0058ffe9-5af5-11e8-bfc7-525400100b82
      Local
      1
   

 


C:\Users\ecloud>ectool getProperty /users/test/email
tester@electric-cloud.com

You can dynamically reference the property so that the user who runs the job is the user whose email is passed in by using $[/users/$[/myJob/launchedByUser]/email].

Have more questions?

0 Comments

Please sign in to leave a comment.