Last updated Mar 5, 2025

Assets app development

The Assets API is essential for customizing your environment to meet your organization's specific needs. Whether you're developing an app or writing a post function, understanding the API is the first step to enhancing your work. Before creating new solutions for Assets, explore the Assets Javadoc and get inspired by Groovy script examples.

Assets Javadoc

To access Javadoc for your version of Assets, use the following link:

1
2
https://docs.atlassian.com/assets/<version>

Where <version> is your Assets version. For example, if you’re using Assets 15.17.5, the Javadoc link is https://docs.atlassian.com/assets/15.17.5.

To check your Assets version, go to Assets, then select Getting started. Not sure which Javadoc you need? Explore the Assets Javadoc directory

Assets REST API

Assets REST API is a part of Jira Service Management REST API. You can use REST API to integrate and customize Assets to your needs. You can integrate with an external system to get the data about your assets or create your post functions. Explore Jira Service Management REST API

Examples of Assets with Jira REST API

Assets supports assigning Assets objects to issues by using the Jira REST API. Below, you’ll find examples on how to do use Assets with Jira REST API.

Create Issue

URI: /rest/api/2/issue

When creating issues with Assets custom field values, use the key attribute to define the Assets object keys.

1
2
{
    "fields": {
       "project":
       {
          "key": "TEST"
       },
       "summary": "REST ye merry gentlemen.",
       "description": "Creating of an issue using project keys and issue type names using the REST API",
       "issuetype": {
          "name": "Task"
       },
       "customfield_10100" : [{"key" : "TEST-1"}],
       "customfield_10200" : [{"key" : "TEST-1"}, {"key" : "TEST-2"}]
   }
}

Update issue

URI: /rest/api/2/issue/[issueKey]

To assign an Assets object to a specific Assets custom field, use the set attribute to define the Assets object keys.

1
2
{
    "update" : {
        "customfield_10200" : [{"set": [{"key" : "TEST-1"}]}]
    }
}

To add an Assets object to the existing connected ones, use the add attribute to define the Assets object keys.

1
2
{
    "update" : {
        "customfield_10200" : [{"add": [{"key" : "TEST-2"},{"key" : "TEST-3"}]}]
    }
}

To remove an Assets object from the existing connected ones, use the remove attribute to define the Assets object keys.

1
2
{
    "update" : {
        "customfield_10200" : [{"remove": [{"key" : "TEST-2"}]}]
    }
}

All Assets custom fields use arrays of keys, even when working with a single Assets custom field. In such cases, the array will contain only one Assets object.

How to set up your app

To use the Assets Java API in your app, specify the dependency on Assets. This allows you to utilize Assets classes in your code.

Maven

In your pom.xml, include the following dependencies:

1
2
<dependency>
    <groupId>com.atlassian.jira.plugins</groupId>
    <artifactId>insight</artifactId>
    <version>${insight.version}</version>
    <scope>provided</scope>
 </dependency>
 <dependency>
    <groupId>com.atlassian.servicedesk</groupId>
    <artifactId>insight-core-model</artifactId>
    <version>${insight.version}</version>
    <scope>provided</scope>
</dependency>

App descriptor configuration

To begin, install Assets locally in your Maven repository. Explore how to install third part JARs

Next, specify the dependency in the app configuration or as an annotation. In atlassian-plugin.xml this should look like this:

1
2
<component-import key="objectFacade"
    interface="com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade"/>

Java example

Assets provides all the necessary packages, allowing you to access the Assets facade classes directly. For example, you can do this:

1
2
...
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade;
import com.riadalabs.jira.plugins.insight.services.model.ObjectBean;
public class MyPluginResource {
    ...
    private final ObjectFacade objectFacade;
    ...
    public MyPluginResource(final ObjectFacade objectFacade) {
        this.objectFacade = objectFacade;
    }
    public ObjectBean getInsightObject(String key) throws Exception {
        return objectFacade.loadObjectBean(key);
    }
}

Tutorials for building Assets app

Our tutorials split into topics to help you learn to develop for Assets and provide complete step-by-step instructions for working through an example. Check out the following tutorial to build your Assets app:

Rate this page: