Hi Experts,
I have one code scenario there i have to get ApplicationUser by username and password in programmatically. Kindly suggest me some reference to solve this problem.
IssueResult createResult = issueService.create( applicationUser, createValidationResult);
Take a look at the UserManager service:
https://docs.atlassian.com/jira/7.2.4/com/atlassian/jira/user/util/UserManager.html
In particular you’ll want:
getUserByName(String userName)
Returns an ApplicationUser based on user name.
or
getUserByKey(String userKey)
Returns an ApplicationUser based on user key.
I would recommend using userKeys since that will handle the username changing properly.
It got solved. please refer to below link:
Hi @david.pinn & @daniel ,
I got the solution. I need to pass basic authentication of JIRA user in header of third party api client then i can able to get logged in user by below methods. Thanks to all.
Request xml of thirrd part api which is calling JIRA Rest service:
[image]
Note: You need to do base64 encode of your username and password in below format:
Example: username:password
Code to get logged in user:
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLo…