Tried Code IssueManager issueManager = ComponentAccessor.getIssueManager();MutableIssue io = issueManager.getIssueObject(issueID);io.setAssigneeId("XXXX");
Got exception
This is not expected to occur on a production system.Developers that encounter this message within a unit testshould use n MockitoMocksInContainer rule to initialize mockito and ComponentAccessor.For more detailed explanation read the documentationfor MockComponentWorker in the jira-tests artifact for more informationabout what causes this error and how to address it.
Hi @pavanbachuDexcom, Please have a look at the similar question at https://community.developer.atlassian.com/t/componentaccessor-not-initialised/1143.
Hope this helps you. Thanks.
@Rambabu Patina {Appfire} I have tried that solution but it's throwing null pointer when setting assignee?
IssueManager mockIssueManager = mock(IssueManager.class);final MockComponentWorker componentAccessorWorker = new MockComponentWorker();componentAccessorWorker.addMock(IssueManager.class,mockIssueManager);ComponentAccessor.initialiseWorker(componentAccessorWorker);MutableIssue io = ComponentAccessor.getIssueManager().getIssueObject(issueID);io.setAssignee(" ");
@pavanbachuDexcom Here what's the user id you are providing in the method
setAssignee(<Provide valid user id>)
I am passing a regular string, is there a better way to get the user id?
It looks like you're new here. Sign in or register to get started.