Custom Web-Item conditions?

This page:
talks about web-item conditions you can use.

But can you create your own custom conditions?

Those condition classes extend com.atlassian.jira.plugin.webfragment.conditions.AbstractIssueWebCondition but it seems the class is not accessible by default in a plugin project.

Hi @KCWong

yes, you can create your own custom conditions, for example:

public class ExampleCondition extends AbstractWebCondition {

    public ExampleCondition()  { }

    public boolean shouldDisplay(ApplicationUser applicationUser, JiraHelper jiraHelper)
        return true;


I need to add this dependency to see the Condition class:

<!-- Plugin web fragment API, for the com.atlassian.plugin.web.Condition class -->

And the issue object is stored in jiraHelper.getContextParams(), under the key “issue”.


Issue issue = null;

if(jiraHelper.getContextParams().get("issue") != null){
    issue = (Issue) jiraHelper.getContextParams().get("issue");