Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

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:

Numbered Headings
start-numbering-ath4

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>4.0.0</version>
  <scope>provided</scope>
</dependency>

Import an interface

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

Tip

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

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

Have Structure API service injected into your component.

Code Block
public class MyClass {
  private final StructureManager structureManager;

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

  ...
}
Panel

Next: Learn API Basics