Populate an Insight customfield according to the 'Filter assign scope IQL' when a Jira issue is created via REST API
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When creating a Jira Issue using the Jira REST APIs, the Insight customfield will not populate automatically, even when a 'Filter assign scope IQL' is set in the customfield configuration.
Cause
The Insight customfield's 'Filter assign scope' will be triggered upon an 'Issue created' event by the "Automatic" object-like label in the UI.
When creating a Jira Issue using the Jira REST APIs, we must set this "Automatic" label as the value of the Insight customfield, in order for it to populate by the 'Filter assign scope'.
Solution
Use the Jira REST APIs payload to set a specific key as the value of an Insight customfield.
See the following payload example (customfield_10704 is the Insight customfield):
{
"fields"
: {
"project"
: {
"id"
:
"10000"
},
"summary"
:
"Setting an Insight CF with the Filter Assign Scope using REST"
,
"issuetype"
: {
"id"
:
"10001"
},
"reporter"
: {
"name"
:
"myUser"
},
"description"
:
"InsightCF - test"
,
"customfield_10704"
: [{
"key"
:
"AUTOMATIC-ASSIGN"
}]
}
}
So, setting:
[{
"key"
:
"AUTOMATIC-ASSIGN"
}]
in the Insight customfield will cause the field to populate according to the 'Filter assign scope' on the Create transition.
Was this helpful?