Filling a custom field with an Epic Value Automation Rule

Bernhard BRUNNER October 8, 2024

Hello,

I have a Text custom field for my issues and when there is a subtask created, that it will be filled by a rule with the name of the parentEpic.

Right now the "Then: Edit issue" looks like this:

"customfield_10111": {"value" : "{{parentEpic.name}}"} 

how it is described here:

advanced field editing using json 

but i get this Error:

"Error while parsing additional fields. Not valid JSON."
I tried it without the "value" and just
"customfield_10111" : "{{parentEpic.name}}"
but same thing.
I also tried just parentEpic, no luck.
In the end I want to have the custom field as a column in my "Issues" query list. So I can see which subtask is in which epic.
Thank you for your help

 

2 answers

1 accepted

2 votes
Answer accepted
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2024

Hi @Bernhard BRUNNER,

For help with automation rules, please share a screenshot of your full automation rule. There's a couple of things we might be able to use, but there's also quite a lot going on in your question that indicates quite a bit of confusion:

  • instead of {{parentEpic.name}}, I would expect something like {{issue.parent.summary}} if your child issue is a task or story;
  • and {{issue.parent.epic.summary}} if the issue really is a subtask

Hope this helps! 

Bernhard BRUNNER October 8, 2024

grafik.png

The rule is really basic. When an issue is created and it is a subtask, fill the custom field with the Epic name.
I assumed that parentEpic is the field name of the issue. Because in JQL you can use that to filter through tasks which are inside that Epic name.
I hope that helps with the confusion and will report how it went with your advices. Thanks

Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2024

There are still a few potential holes in your use case itself, @Bernhard BRUNNER.

First of all it is not very common to add sub-tasks directly to an epic. They are usually added as child issues to the issue level below epics, most commonly being stories or tasks.

If you add a sub-task to a task, your automation rule is doing nothing to verify if the parent task/story is a child issue of an epic in itself, which may again lead to errors.

Finally, unless your customfield_10109 is a very specific, unsupported field, it would be way easier to select it (by its name) from the dropdown "Choose fields to set" and then add the appropriate smart value there, instead of using the advanced fields syntax. If you decide to do that, make sure to remove the json that is now there, as you can't update the same field twice.

Like # people like this
Bernhard BRUNNER October 9, 2024

I am confused, i was trying to find the custom field in the dropdown menu but it didnt show up. I thought because it is a custom field, but now it is there and issue.parent.epic.summary did it.

We have a weird structure in our system, so there is a task between subtask and epic. and all our tasks have epics.
Thanks for your help

1 vote
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2024

Hi @Bernhard BRUNNER 

It's not valid JSON as 'parentEpic.name' won't expand.

Use the smart value {{parent.Epic Name}} (include the space between Epic and Name).

 

Bernhard BRUNNER October 8, 2024

thanks, I assumed that since in JQL you can filter Issues with parentEpic this would be the same name.

I wasnt aware of smart values yet. thanks

Suggest an answer

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

Atlassian Community Events