Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,705
Community Members
 
Community Events
165
Community Groups

Push custom field from epic to child tasks

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

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}}" }
}
}

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
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,239 views 35 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you