Get logged in user email in app.js

Hi,

I would like to get the logged-in user email address for further usage by a custom jira App.

Hello Norb,

I hope this helps.
https://docs.atlassian.com/software/jira/docs/api/7.1.9/com/atlassian/jira/user/ApplicationUser.html#getEmailAddress--

authenticationContext.getLoggedInUser().getEmailAddress();

Let me know how it goes.

Hello @Taylan,

May I ask, how can I import this the app.js?
This is a custom ui project and build with npm then deploy with forge.

Thank you so much for your help.

Hello @Taylan,

As I can read here:
https://developer.atlassian.com/platform/forge/app-context-security/
I can get the account ID, it could be good, because I can get the email of the user by it’s ID in my application, so if you know, how to get the ID of the user, it could be good as well.

The context I get by the resolver only gives me the issue information :frowning:

Hello @norb_szolnoki

I am not sure on how you can import that into the app.js as I am not developing solutions for cloud. On the server side I would have suggested you to put it in the Velocity context and use it from there.
For getting the userID please check these threads since I haven’t implemented a feature where I get the user ID.