How to change state of web section plugin module using atlassian api

I have defined web section plugin module in my atlassian-plugin.xml

<web-section key="pluginkey" name="pluginname" location="admin_plugins_menu" weight="100" state="disabled">
<label key="plugin space"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition" />
</web-section>

and by default its state is disabled. I am also using atlassian licensing api.
I want to display this web section to user only after perfrming validation on jira-license.
how do I make web section enable again after perfroming license check?

3 answers

1 accepted

This widget could not be displayed.

I think it is as straight forward as writing a new validation class and define that class name in your web-item definition in the atlassian-plugin.xml

And in the validation class, use the license api and check for the license status.

Read this https://developer.atlassian.com/display/JIRADEV/Web+Item+Plugin+Module#WebItemPluginModule-conditionElements

This can also be done using pluginController.disablePluginModule() method

This widget could not be displayed.

Hi,

I think that you have missed , web-item or in location replace "admin_plugins_menu" with "system.admin"

look to this example, it can help you.

https://developer.atlassian.com/display/JIRADEV/Web+Section+Plugin+Module

This widget could not be displayed.

HI zezeto,

I have not provided web-item module in my question but i have defined them in my plugin.xml. And my web section module is working fine with location="admin_plugins_menu". I want to know how to make this section enabled and disabled using jira api

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

534 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you