I'm trying to make my plugin that is compatible with versions 4.4 to 5.0. I'm trying to get it available down to 4.2. I noticed that the following method is not available:
getJiraAuthenticationContext().setLoggedInUser(user);
Any ideas how you do this? I need to log a user in before I can automate the creation of an issue with that user being the assignee.
You will need to create a different version of the plugin. JIRA 4.2 uses OSUser and you will have to use setUser method.
In JIRA5, this method is not available.
So, the top is how i did it in version 4.5+ Below it is how it be done in earlier versions.
ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(user);//log user in user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();//grab reference to the logged in user
user = compManager.getUserUtil().getUser((String) issueData.get(ASSIGNEE_FIELD));//grab user compManager.getJiraAuthenticationContext().setUser(user);//log user in
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.