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 similar. JIRA allows conditions to be added while defining the web items, and the web item won't show up when the conditions are not satisfied.
In this recipe, let us lock down the new issue operation, created in the previous recipe, to a specific user named admin.
Getting ready...
Create the ManageProject 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
conditionclass. Since the issue operation is a web item, the easiest thing to do is to extend thecom.atlassian.jira.plugin.webfragment.conditions.AbstractWebConditionclass.While extendingAbstractWebCondition, we will have to implement theshouldDisplaymethod, as shown here:      @Override       public boolean shouldDisplay(ApplicationUser user...