Jira DC - A4J rule is unable to find relevant objects on an Assets (prev. Insight) custom field when attribute "Name" does not exist

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

While trying to configure an A4J automation rule, on the Edit Issue action if you choose an Assets Custom Field, you will not be able to find any objects in the search results if you don't have an attribute called "Name" for the related object type.

Diagnosis

While trying to choose the Assets Object in an Automation Rule configuration, the object search is always done with the "Name" attribute:

Screenshot Rule creation
1 https://<JIRA>/rest/insight/1.0/iql/objects?iql=objectTypeId=51%20and%20Name%20like%20XXX

However, if the object does not have a "Name" attribute the search fails to find the objects.

Cause

This mechanism is hardcoded at the moment with the Assets Custom field object search and cannot be modified without a code fix. This is reported to the engineering in these two tracker tickets:

JIRAAUTOSERVER-1052 - A4J always searches objects by "Name" attribute in Edit Issue action for Assets Custom fields

JIRAAUTOSERVER-505 - As a customer, I'd like to search for objects in A4J configurations with the attribute I set as label

If you're impacted by this issue, please make sure to watch/comment/vote for the ticket to add to the frequency and raise visibility.

Solution

Instead of choosing the object from the dropdown, use the JSON payload method in order to set the value (examples here)

RuleAssets
RuleAssetsContent

Payload in text:

1 2 3 4 5 { "update" : { "customfield_10304" : [{"set": [{"key" : "SAMITSM-18"}]}] } }

Updated on August 21, 2024

Still need help?

The Atlassian Community is here for you.