Insight have support for assign Insight objects to issues via the JIRA REST-API. Below you will find examples on how to do this:
This is supported from version Insight 2.24.0
Create Issue
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"}] } }
Update issue
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"}]}] } }
All Insight custom fields are using ARRAYs of keys, even if you only work with single Insight custom fields. In that case, it will only contain a list of one (1) Insight object.