Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JiraHelper in more than one ContextProvider

Jorge Jerez
Contributor
March 8, 2019

I'm using two web panels in the Issue Screen, they are totally different.

 

They have to load depending of the project, so i use JiraHelper.getProject()

 

In the first panel, it works fine, jiraHelper contains the project.

But in the other, jiraHelper project is null, I saw it with Debug options.

This is making only one of my panels load, but i need both.

1 answer

0 votes
Sven Jerat
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 3, 2019

You can try to make a try / catch block around your code.

try {
projectId = jiraHelper.getProject().getId();

} catch (Exception e) {
log.error(e);
}

It's working for me. I get a nullpointerexception AND the projectId.

But I didn't understand why!

Suggest an answer

Log in or Sign up to answer