Assistance with automation to add custom field values from Epics to Initiatives in Jira Cloud

Maria Savignano May 29, 2024

I need to create an automation that checks a custom multi-select field that is present in both the Epic and the Initiative. The automation needs to work as follows:
If a value is added to the custom field, let's call it customfield_1, it should check if the value is present in the Initiative, and if it's not, it should add it.
I tried creating the automation by copying the field from the Epic to the Initiative, but it doesn't work because there are Epics associated with the Initiative that have different values in that field. The idea behind this is to ensure that the Initiative's field collects all the values from the associated Epics.

I used the component: Edit Issue and in the advanced option, I put the following JSON:

{
"update": {
"customfield_1": [
{
"add": {
"value": "{{issue.fields.customfield_1}}"
}
}
]
}
}

 

But this way it gives an error: (The value 'Xx, XX' is not valid for customfield_1) and the specified options are valid.

We tried modifying the rule using a lookup table with smart values, but it doesn't work, as it clears the value of the field in the Initiative and replaces it with the value from the Epic that was just linked.

 

Does anyone have any ideas on how I could achieve this?

 

Thanks in advance! 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2024

Hello @Maria Savignano 

Can you please share with us images that show your entire Automation Rule? Sometimes the problem is related to the context in which the step is executing, and we can't discern that without seeing the entire rule.

I suspect there may be multiple problems:

1. You said the field is a multiple selection field. The way your JSON is written you are referencing the entire field with all its values. That is not the correct syntax to get just one value added to the multiple selection field.

2. If the JSON you have written is trying to add a value from one issue to another issue, the syntax is likely not correct for referencing the value from the source issue (the Epic?). But we can't tell you the correct syntax without seeing your entire rule to be able to determine the context in which the step is executing.

Maria Savignano June 3, 2024

Hello @Trudy Claspill

 

I've tried creating the automation in many ways:

 

2024-06-04_08h02_23.png2024-06-04_08h18_48.png

But it doesn't work as I expect :(

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 4, 2024

Hello @Maria Savignano 

Looking at just the second rule image you provided:

Trigger: the value for Responsible Area is changed

Condition: Project = DID

Condition: There are linked incidents present:
Types: is part of

Branch: For Linked incidents
Types: is part of

Edit incident fields

 

First I would recommend that you might want to add a condition after the trigger to check that the rule has been triggered by the value being changed in an Epic type of issue.

Second, are the Epic and the Initiative related through generic issue linking, or is the Epic a child issue of the Initiative? The way the rule is written it is looking at the generic issue link type of relationship rather than the parent/child relationship that is available with the Premium subscription if you have extended the Issue Type Hierarchy.

Third, in the JSON code are you trying to update the linked issues with data from the issue that triggered the rule? If so then the code is definitely incorrect.

And finally, I need clarification about what you are intending to do. In your JSON you have referenced "customfield_1", but in all other places you have referenced the field "Area Responsable". Is the "Area Responsable" field the one you are trying to update with your JSON code, or is the JSON code for updating a different field?

 

Maria Savignano June 10, 2024

Hi @Trudy Claspill  I'm responding to your questions:


2. The Epic and Initiative are related through generic issue links. We don't have premium subscription.
3. Yes, I want to copy the value of the field "Área de Soporte" from the Epic (the issue that triggered the rule) to the linked Initiative. What would be the correct JSON?
4. Yes, customfield_1 corresponds to the "Área de Soporte" field. It's not actually named customfield_1; I used that name because I couldn't remember the exact field number for "Área de Soporte" at the time of taking the screenshot. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events