Push custom field from epic to child tasks

Brad Christiansen May 18, 2022

I am working on a JIRA automation for a team-managed project where a specific dropdown style custom field is in both an epic and its child stories/tasks.

I can trigger the event properly, its grabbing the right child tasks, but I'm getting invalid JSON errors on the Edit issue fields action:

{
"fields": {
"customfield_11354": {{"issue.customfield_11354"}}
}
}

 

customfield ID number was obtained from issue settings > custom fields > [my custom field] > looking at the URL.

I've also tried:

"customfield_11354": {{"issue.customfield_11354.id"}}

"customfield_11354": {{"issue.customfield_11354.value"}}

"customfield_11354": {{"issue.customfield_11354.name"}}

Thanks

2 answers

1 accepted

2 votes
Answer accepted
Brad Christiansen May 19, 2022

Because I was within a "for loop" for each of the epic's stories and other children, the following is the correct usage:

{
"fields": {
"customfield_11331" : { "id" : "{{issue.parent.customfield_11331.id}}" }
}
}

0 votes
Brad Christiansen May 18, 2022

I set up a log to see what value is coming back for:
{{issue.customfield_11331.id}}

This returns a valid number (XXXXX).

I then update the edit action to:

{
"fields": {
"customfield_11331" : { "id" : "XXXXX" }
}
}

This works.  However, when I update the edit action to:
{
"fields": {
"customfield_11331" : { "id" : "{{issue.customfield_11331.id}}" }
}
}

It does not work.  It completes with "success" and the correct tasks are shown affected by the rule, but when you go to the Task(s), the custom field is not updated properly.

I've tried removing the quotes from the smart tag and that throws an error:
Specify a valid 'id' or 'name' for Business Case (customfield_11331)).

Suggest an answer

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

Atlassian Community Events