Update Asset Automation (scriptrunner) Issue for Multi-Select List field using asJsonObjectArray

Christian Thema June 27, 2024

Application Info: JIRA Data Center Version 9.0.0

 

Goal: Folks, I'm trying to update an Asset (insight) Object attribute with a multi-select field in JIRA. 

Current Outcome: I'm running into a min cardinality error. I followed the steps here, but that isn't working -

Context: Both the JIRA field (called: Hosting) and the Object attribute (called: hosting) are multi-selection option. 

Steps to Reproduce: 

  1. Create an object with a multi select attribute (go to attribute> type 'default' > Type value 'Select' 
  2. Enter options for the attribute
  3. In Jira custom fields, create an assets custom field referring to the object you created in step #1 and configure to ensure it is pulling the object created in #1
  4. In jira custom fields, create a multi-select list custom field mirroring the attribute you created in step #1. ( In my case, I used Hosting as an attribute and Hosting as a custom field. They both have the exact same field options)
  5. Associate the custom fields in #3 and 4 to a project and screen
  6. Create an automation with the following details:
    1. Trigger: Field value change - Select the field created in step#4
    2. Action: Update Asset - use the following syntax (update it to fit your config)
{
    "objectKey": {{issue.Model(s).key.asJsonString}},
    "Hosting": {{issue.customfield_76510.asJsonObjectArray("value")}}
}

 

Error: I'm getting the following error

 

Unexpected error executing rule: ValidationInsightException: Validation errors were found: rlabs-insight-attribute-15: ErrorMessage{i18nKey='rlabs.insight.i18n.constraint.violation.ObjectAttributeValueBean.MinOne.value', parameters=[], additionalMessage=null};

 

Screenshot below

Audit Log.png

 

Here is how I set up the Automation:Trigger.png action.png

Here is the matching attribute in Assets

object attribute.png

I'd greatly appreciate any help on this topic

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events