アセット アプリ開発

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

The Assets Java API plays an important part in customizing your environment to fulfill special requirements that are specific to your organization. Whether it’s creating your own app or writing a post function, getting to know the API is your first step on your road to helping you improve the way you work.

Before you start developing any new solutions for Assets, check out the Assets Javadoc and Groovy script examples to get inspired.

How to set up your own app

If you want to use the Assets Java API from you app, you need to specify the dependency to Assets, so that you can use Assets classes in your code. 

Maven

pom.xml

<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

You need to install Assets locally in your mvn repository. Read more about how to do this in Maven’s documentation: Guide to installing 3rd party JARs.

You also need to specify the dependency in the app configuration (or as an annotation).

atlassian-plugin.xml では、次のようになります。

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

Java の例

Assets exports all the necessary packages so you can just access the Assets facade classes by doing something like this:

...
 
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);
    }
     
}


その他のリソース

詳細については、次のページを確認してください。

最終更新日 2024 年 5 月 15 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.