Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get Current Issue from AbstractWebCondition?

I found this code:

Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
JiraHelper jiraHelper = new JiraHelper(); // doesn't work

This code is in my class which extends AbstractWebCondition.

1 answer

Hi @navya k 

You can't use JiraHelper by creating instance with new JiraHelper().  

In order to get the issue in a class that extends AbstractWebCondition, you should override the shouldDisplay method as follows and use jiraHelper this way

@Override
public boolean shouldDisplay(ApplicationUser user, JiraHelper jiraHelper) {
Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
}

I hope it helps

@Tuncay Senturk _Snapbytes_ 

Thanks for replying.

I'm following the same way, but I'm getting null for jiraHelper.

Are you getting null for jiraHelper?

Where are you using this WebCondition? Can you give some details?

I have created Web item and added 

WebItemIssueCondition extends AbstractWebCondition {

public boolean shouldDisplay(ApplicationUser applicationUser, JiraHelper jiraHelper) {
Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
}
}

 and getting null for jiraHelper.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you