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:

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

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

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

Have Structure API service injected into your component.

public class MyClass {
  private final StructureManager structureManager;

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

  ...
}

Next: Learn API Basics