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 votes

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
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,128 views 0 8
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