Hello !
So I have this web-panel:
<web-panel key="mypanel" name="my panel" location="atl.jira.view.issue.right.context"> <condition class="my.IssueCondition" /> <resource name="view" type="velocity" location="templates/panelview.vm"/> </web-panel>
I tried to get the current Issue in the IssueCondition.class :
public class IssueCondition implements Condition{ private JiraHelper helper; public IssueCondition(JiraHelper helper){ this.helper = helper; Issue currentIssue = (Issue) helper.getContextParams().get("Issue"); } ...
This code doesnt work! Seems like JiraHelper is not injectable or... Condition classes are not CDI aware?
Thanks for help!
Community moderators have prevented the ability to post new answers.
Make your condition to inherit from AbstractIssueWebCondition and Jirahelper is passed to shouldDisplay:
public class IssueCondition implements AbstractIssueWebCondition { ... @Override public boolean shouldDisplay(final ApplicationUser user, final Issue issue, final JiraHelper jiraHelper) { ... } ...
Ahh I found the AbstractIssueCondition class:https://docs.atlassian.com/jira/6.4.3/com/atlassian/jira/plugin/webfragment/conditions/AbstractIssueCondition.html
This might be exactly what I need
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes this works, but this classes are deprecated. This means it works also with older jira versions. if you want to be modern, look at the accepted answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.