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

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

right. sorry 'bout that

right, sorry

0 vote

While line is throwing NPE?

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

849 views 2 9
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