@Rambabu Patina I have tried that solution but it's throwing null pointer when setting assignee?
IssueManager mockIssueManager = mock(IssueManager.class);
final MockComponentWorker componentAccessorWorker = new MockComponentWorker();
MutableIssue io = ComponentAccessor.getIssueManager().getIssueObject(issueID);
You already have the ComponentAccessor reference, so
If you want to get the current logged in user try
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
To get other users try:
ApplicationUser currentUser = ComponentAccessor.getUserManager().getUserByKey(String userKey);
ApplicationUser currentUser = ComponentAccessor.getUserManager().getUserByName(String userName);
Hope this helps you.
IssueManager issueManager = ComponentAccessor.getIssueManager();
MutableIssue io = issueManager.getIssueObject(issueID);
This is not expected to occur on a production system.
Developers that encounter this message within a unit test
should use n MockitoMocksInContainer rule to initialize mockito and ComponentAccessor.
For more detailed explanation read the documentation
for MockComponentWorker in the jira-tests artifact for more information
about what causes this error and how to address it.
Hi Atlassian community, A few months ago, we offered a sneak peak of the new hierarchy view on the roadmap. Thank you for all the feedback (and excitement) and for helping us shape the direction of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events