With the Insight JAVA API you may customize your organization to fit your special requirements. You may want to create your own plugin or post function to do that specific thing to help your organization. Read the Insight Javadoc to be able to create your own customizations and see the Groovy script examples to get more inspiration on what you can do and something to start with.

独自のプラグインをセットアップする方法

独自のプラグインから Insight JAVA-API を使う場合、Insight の依存関係を指定して Insight クラスに対してコーディングできるようにする必要があります。 

Maven

pom.xml

<dependency>
  <groupId>com.riadalabs.jira.plugins</groupId>
  <artifactId>insight</artifactId>
  <version>${insight.version}</version>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>com.riadalabs</groupId>
  <artifactId>insight-core-model</artifactId>
  <version>0.2.2</version>
  <scope>provided</scope>
</dependency>

You need to install insight locally into your mvn repository. Read more about how to do that here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

プラグイン記述子の設定

また、プラグインの設定で (アノテーションとして) 依存関係を指定する必要があります。

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

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

Java の例

Insight は必要なすべてのパッケージをエクスポートしたので、次のような操作を行うだけで insight facade クラスにアクセスできます。

...

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




  • ラベルなし