Documentation for JIRA 5.0. Documentation for other versions of JIRA is available too.

A service is a class that runs periodically within JIRA. Since a service runs inside JIRA, it has the ability to use all of the JIRA API — and, as it is written in Java, it can use any Java libraries.

Services are useful because they enable you to integrate with external systems by pulling data into JIRA periodically. JIRA comes with a number of pre-written services, and custom services can be written and plugged in at runtime. If you want a service to perform typical operations on JIRA issues (eg. close a list of issues meeting certain criteria), then the Jelly Service can be configured to run a custom Jelly script.

(tick) 新しいサービスを作成しませんか?

If you are not extending a built-in JIRA service, you should strongly consider writing your new service using the SAL API. Please see our Plugin Tutorial - Scheduling Events via SAL for more information.

サービスの登録

(info) For custom-written services, make sure your service class is in the classpath where JIRA can see it — the best locations are usually the <jira-application-dir>/WEB-INF/classes or <jira-application-dir>/WEB-INF/lib subdirectories within of your JIRA Installation Directory (as JAR files).

To set up a JIRA service:

  1. Log in as a user with the JIRA System Administrators  global permission.
  2. Select Administration > System > Advanced > Services (tab) to open the Services page.
    (tick) Keyboard shortcut: g + g + start typing services
  3. In the Add Service  form at the bottom of the page, complete the following fields:
    • 名前 - このサービスの記述名。
    • Class — the fully-qualified class name of your service. This is likely to have the form com.atlassian.jira.service.services.type.TypeService
      See Sample services for provided service class names.
      (info) To use one of JIRA's built-in service classes, first click the Built-in Services link to expand the list of service classes and then click the name of the specific class in the list. The fully-qualified class name of the built-in service will be added to the Class field.
    • Delay — the delay (in minutes) between service runs.
      For example, to add a debugging service, click the Built-in Services link followed by the Debugging Service link:
  4. After completing the fields on the Add Service form, click the Add Service button. This opens the Edit Service page, where you can configure your new service's options.
    (info) Your service's options will vary depending on the type (i.e. class) of service you chose.
  5. 編集サービス ページの残りのオプション設定を完了したあと、更新 ボタンをクリックして、新しいサービスのオプションを保存します。

On this page:

(warning) The information on this page does not apply to JIRA OnDemand.

サービス プロパティの編集

To edit a service's properties:

  1. JIRA システム管理者」 グローバル権限を持つユーザーとしてログインします
  2. Select Administration > System > Advanced > Services (tab) to open the Services page.
    (tick) Keyboard shortcut: g + g + start typing services
  3. プロパティを編集したいサービスに関連付けられた 編集 リンクをクリックします。

たとえば、JIRA からメールが送信される間隔を変更するには、メールキューサービス を編集し、遅延 を既定値の 1 分から変更します。

サービスの削除

To remove a service:

  1. Log in as a user with the JIRA System Administrators  global permission.
  2. Select Administration > System > Advanced > Services (tab) to open the Services page.
    (tick) Keyboard shortcut: g + g + start typing services
  3. 削除したいサービスに関連付けられた 削除 リンクをクリックします。

組み込みサービス

JIRA にはすぐに利用できる便利なサービスがあり、そのまま使用することもできれば、独自の環境で使用するために修正することもできます。組み込みサービスのすべてのソースコードが利用可能で、独自のサービスを作成する簡単さがよくわかります。すべての組み込みサービスは JIRA に含まれており、使用に必要なのは設定だけです。

エクスポート サービス

エクスポート サービスは、定期的に JIRA をバックアップするのに便利です。このサービスが実行されるたびに、パラメーターとして用意されたディレクトリに、JIRA のデータがすべてエクスポートされます。エクスポート ファイルにはタイムスタンプが付けられるため、このサービスはバックアップシステムとして機能します。

To test this service, add a service with the class com.atlassian.jira.service.services.export.ExportService. JIRA sets up an ExportService in new JIRA installations (once the setup wizard has been completed). Hence, you may find you already have one.

You can find this class within the following directory of an expanded JIRA source archive (which can be downloaded by JIRA customers from https://my.atlassian.com):
<source-installation-directory>/jira-project/jira-components/jira-core/src/main/java/com/atlassian/jira/service/services/export

Jelly service

Jelly is a scripting language which allows tasks in JIRA to be automated. The Jelly Service periodically runs a Jelly script. For example, you could use this to periodically run a search request, loop through the results and add a comment, change the issue state (see the Jelly examples).

If you are considering writing a custom service, often a periodically invoked Jelly script may be an easier alternative.

In Linux, the input-file and output-file properties are relative to your system's / folder. Please be careful to select a path that JIRA will have access to.

 

You can find this class within the following directory of an expanded JIRA source archive (which can be downloaded by JIRA customers from https://my.atlassian.com):
<source-installation-directory>/jira-project/jira-components/jira-core/src/main/java/com/atlassian/jira/jelly/service

メールハンドラ サービス

JIRA mail handler services are not configurable through JIRA's Services page (with the exception of being able to be removed). For more information about configuring a mail handler in JIRA, including the creation of custom mail handlers, please refer to Creating Issues and Comments from Email.

カスタム サービス

If you are a JIRA developer who wishes to write your own JIRA service, please note that JIRA Service classes must all extend com.atlassian.jira.service.JiraService. Most do so by extending com.atlassian.jira.service.AbstractService or some more specialised subclass.