My Plugin won't work in every Jira environment

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;
	}

5 answers

This widget could not be displayed.

Please post your code extract. So we can see what the reason for the error.

This widget could not be displayed.

right. sorry 'bout that

This widget could not be displayed.

right, sorry

This widget could not be displayed.

While line is throwing NPE?

This widget could not be displayed.

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 ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you