The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to show web-item in one case and doesn't show othewise?

Влад Демидик
August 7, 2018

I develop jira plugin. Faced this problem: i have bool setting and i need show my web-item when this flag is switched on and doesn't show when turned off.

Mb someone know how to do it?

Thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Tuncay Senturk _Snapbytes_
Community Champion
August 7, 2018

Hello,

You need to add a condition into your web-item in atlassian=plugin.xml

<web-item ..
<
condition class="com.mypackage.MyCondition" />
</web-item>

 

Here is the snippet of the condition class

public class MyCondition extends AbstractWebCondition {

@Override
public boolean shouldDisplay(ApplicationUser user, JiraHelper jiraHelper) {
return // true or false according to your bool setting
}
}
Влад Демидик
August 8, 2018

Thanks, it works!

TAGS
AUG Leaders

Atlassian Community Events