This documentation relates to an older version 2.1 of the Structure Plugin for JIRA. View the current documentation home.

Skip to end of metadata
Go to start of metadata

Structure provides a Java API that lets other plugins interact with the Structure data. The API is accessed through a few services that you can have injected into your components.

To start using Structure in your plugin:

1. 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:

<dependency>
  <groupId>com.almworks.jira.structure</groupId>
  <artifactId>structure-api</artifactId>
  <version>7.2.0</version>
  <scope>provided</scope>
</dependency>

2. Import an interface

In your atlassian-plugin.xml, use <component-import> module to import the interfaces that you need.

You can import StructureServices and get all other interfaces from there.

<component-import key="structure-services" interface="com.almworks.jira.structure.api.StructureServices"/>

3. Have Structure API service injected into your component.

public class MyClass {
  private final StructureManager structureManager;

  public MyClass(StructureServices structureServices) {
    structureManager = structureServices.getStructureManager();
  }

  ...
}
  • No labels