Email of user executing job in chatops


We can get the user name of the user that started a job in chatops with ‘api_user’ in st2 context. Is there a way we can get the email associated with the user profile? I am trying to send an email to the user after job completion with complete log. Thanks for the help!

ST2 doesn’t maintain a list of email addresses for users.

You need to figure out where in your environment you keep that mapping between usernames and email addresses, and write an action to query that system.

Unfortunately that seems to be the case. I do see in ChatOps my email is listed in the profile so was hoping there’s a way to get that email. Thanks

Depending on the chat provider, it might post that info to ST2. If it doesn’t, you could write an action query the Chat tool you’re using. If it’s Slack, there is probably already something in the Slack pack