Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To start using Structure in your plugin:

 Add dependency to your pom.xml

Figure out the version of the API that you need – it may depend on your JIRA and Structure plugin version.

To use API classes, add the following dependency:

Code Block
<dependency>
  <groupId>com.almworks.jira.structure</groupId>
  <artifactId>structure-api</artifactId>
  <version>17.0.0</version>
  <scope>provided</scope>
</dependency>
Tip

Note that there are Additional Libraries Used in Structure API

Import StructureComponents

In your atlassian-plugin.xml, use <component-import> module to import StructureComponents service. This service provides access to all other Structure services.

Alternatively, you can import specific services.

Code Block
<component-import key="structure-components" interface="com.almworks.jira.structure.api.StructureComponents"/>

Have Structure API service injected into your component

Code Block
public class MyClass {
  private final StructureManager structureManager;

  public MyClass(StructureComponents structureComponents) {
    structureManager = structureComponents.getStructureManager();
  }

  ...
}

 

This is it! Continue to the list of Structure Services to see which service you need to work with. Other articles in this section provide examples for specific use cases.

Tip

For a production plugin, consider Controlling Compatibility. For a standalone plugin, which can work without Structure, read about Making Structure Dependency Optional.