I've developed a Plugin which creates a copy of an Issue. It works just find when I use it on my localhost but doesn't when I try integrating it in our test environment.
I allways get a NullPointerException from the method that returns the IssueInputParameters for the new Issue.
I already thought of required fields which might not have been set.... but as far as I know I would get an InvalidCreationResult instad of a NullPointerException.
Does anyone know why I get this strange NullPointerException?
Code:
public IssueInputParameters newIssueParameters(String name){ IssueInputParameters newParams = issueService.newIssueInputParameters(); Collection<ProjectComponent> components =getCurrentIssue().getComponentObjects(); List<Long> ids = new ArrayList<Long>(); for(ProjectComponent comp : components) ids.add(comp.getId()); Long[] array = new Long[ids.size()]; newParams.setComponentIds(ids.toArray(array)); newParams.setSummary(name); newParams.setProjectId(getCurrentIssue().getProjectObject().getId()); newParams.setIssueTypeId(getCurrentIssue().getIssueTypeObject().getId()); newParams.setAssigneeId(getLoggedInUser().getDisplayName()); newParams.setPriorityId(getCurrentIssue().getPriorityObject().getId()); newParams.setReporterId(getLoggedInUser().getDisplayName()); return newParams; }
2 Jobin:
I allways get a NullPointerException from the method that returns the IssueInputParameters for the new Issue.
So maybe it's this line?
IssueInputParameters newParams = issueService.newIssueInputParameters();
Is "issueService" != null ?
While line is throwing NPE?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post your code extract. So we can see what the reason for the error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.