Insight は、Jira REST-API を介した課題への Insight オブジェクトの割り当てをサポートしています。ここでは、その方法の例をご紹介します。

This is supported from version Insight 2.24.0

 

課題の作成

URI:   /rest/api/2/issue

As you can see below, you will have to use the key attribute to define the Insight object keys, when creating Issues with Insight custom field values.

{
    "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"}]
   }
}

 

課題を更新する

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

This is an example of setting an Insight object to a specific Insight custom field. Use the attribute set to define the Insight object keys

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


This is an example of adding an Insight object to the existing connected ones. Use the attribute add to define the Insight object keys

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


This is an example of removing an Insight object from the existing connected ones. Use the attribute remove to define the Insight object keys

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


すべての Insight カスタム フィールドは、単一の Insight カスタム フィールドのみを扱う場合でも、キーの配列を使用します。その場合、Insight オブジェクト リストは 1 つのみ含まれます。

  • ラベルなし