Conditions on issue operations
When new operations are created, it is often a requirement to hide them or show them based on the permissions or state of the issue or something else. JIRA allows conditions to be added while defining the web items, and when the conditions are not satisfied, the web item won't show up!
In this recipe, we will lock down the new issue operation we created in the previous recipe to Project Administrators exclusively.
Getting ready...
Create the Manage Project issue operation, as explained in the previous recipe.
How to do it...
Following are the steps to add a new condition to an issue operation's web item:
Create the
condition
class. The class should implement thecom.atlassian.plugin.web.Condition
interface, but it is recommended to extendcom.atlassian.jira.plugin.webfragment.conditions.AbstractIssueCondition
when creating an issue condition.While extending
AbstractIssueCondition
, we will have to implement theshouldDisplay
method, as shown here:public class AdminCondition...