Forums

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

How to enable/disable structure plugin using API ?

Wanessa Rodrigues do Nascimento January 29, 2020

Hello everyone, 

I would like to know if exist a API to enable and disable the Structure in a specific project. 

I know that it is possible in the admin page but I need to implement that as a feature, all new projects created should be disable by default, but if the user desire, he can turn the structure plugin enable to his project. 

in case of does not have a API how can I do that ? Any suggestion ? 

In advanced, thank you !!

1 answer

1 accepted

1 vote
Answer accepted
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2020

Hi,

Yes, that's possible using Structure Java API. You need StructureConfiguration interface:

https://almworks.com/structure/javadoc/latest/com/almworks/jira/structure/api/settings/StructureConfiguration.html

You're looking for methods setEnabledForAllProjects() and  setPickedProjectIds() with corresponding getters. 

Be careful when setting the picked projects, you need to observe the format.

If you're not integrating with Structure yet, this is a good place to start: https://wiki.almworks.com/display/structure/Accessing+Structure+from+JIRA+Plugin

Good luck!

Igor

Wanessa Rodrigues do Nascimento January 30, 2020

Hi Igor, 

I saw that documentation. I will try to implement that. I have same concerns about permissions. 

Many thanks for your answer. 

Suggest an answer

Log in or Sign up to answer