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,298,358
Community Members
 
Community Events
165
Community Groups

Inherit Team field from parent issue using Automation

Our team is using the Team field to organize our Roadmap and Scrum boards. In order to make sure things don't fall through the cracks, I'd like to automatically inherit the Team field from parent tickets when new tickets are created. While this is easy to to do using Automation for fields like Component and Fix-Version, I can't figure out how to get it to work with the Team field since it doesn't show up as a field option. 

 

Does anyone know if it's possible to use Automation to inherit Team from a parent issue? If so, what is the best approach?

 

Thanks!

4 answers

1 accepted

I finally was able to solve it!

This would do the trick:

 

{
"fields": {
"team": "{{issue.epic.team.id}}"
}
}

Seems to work. Thanks

Yup, it worked! Just had to replace "team" with the custom_field_id in the system. Thanks!

@Bishop Justice 

We'd like too to inherit team from story to sub-task but failed to do so. We managed to get the team from parent but failed to assign it. The team field stayed with "None" value. We've tried several options:

"customfield_10500": {{issue.parent.customfield_10500.id}}

"team": {{issue.parent.customfield_10500.id}}

"team": {{issue.parent.customfield_10500}}

In order to inherit team down the issue hierarchy, I couldn't find the answer anywhere and then I finally managed to figure it out myself. Hopefully this answer helps others:

Our issue hierarchy is as follows:

Theme -> Initiative -> Epic -> Story/Bug/Task

I set up two rules as follows:

Screenshot 2022-06-29 at 14.05.04.png

The non epics rule was intended to populate the team field in initiatives and epics from Themes and initiatives respectively. It looks like this:

Screenshot 2022-06-29 at 14.07.47.png

The action was the following JQL:

{
"fields": {
"team": "{{triggerissue.team.id}}"
}
}

 

The other automation rule was to cover stories/bugs/tasks having their team field copied from the Epic they are in. This rule looked like this :

Screenshot 2022-06-29 at 14.10.43.png

and the action part was JQL that looked like this:

{
"fields": {
"team": "{{issue.epic.team.id}}"
}
}

Both of these worked independently, but I need to couple them together so that if a Theme was changed, it rippled down through initiative, epic and story. In order to do this, I checked the checkbox in the rule details for BOTH rules as follows:

Screenshot 2022-06-29 at 14.13.06.png

This still didn't quite work until I also changed a setting in the Epic rule branch definition to uncheck the following box:

Screenshot 2022-06-29 at 14.14.18.png

Unchecking this box gives you a warning about performance issues as can be seen above, but I haven't noticed any perceptible change. 

Once you've done all these steps, you should be seeing changes to the team field ripple right through.

Did you ever resolve this @Bishop Justice ?  

I have tried various approaches including creating a custom variable. I can 'get' the data, but I just can't set the value on Team. 

I'm guessing this relates to: https://jira.atlassian.com/browse/JSWCLOUD-19957 

I couldn't find a way to inherit from a parent but I did figure out how to set the field. I ended up using a conditional on a component and used that to set the team field with the additional field code below. It's not perfect, but it gets the job done.

{
"fields": {
"customfield_10800" : "123"
}
}
Like # people like this

Hello @Bishop Justice 

What types of issues are the "parent" and what types of issues are the "child" in your scenario?

Our hierarchy is Initiative -> Epic -> Task/Story/Bug. Ideally Epics would inherit from Initiatives, and Tasks/Stories/Bugs would inherit from their Epics.

Hi @Bishop Justice 

One way to find smart values for fields you want to access is to identify an example issue with the field and use the REST API to make a call in a browser.  Then look at the JSON to find the name.

Here is the how-to documentation for that method:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Best regards,

Bill

Thanks for the tip @Bill Sheboy! That helps me find the field I need, but not make use of it. How would I apply a parent's Team field when creating the child using automation? I'm assuming I can do it using the additional fields area in edit issue in automation, but I'm not sure how.

Once you have the field identified, you can first try to use the Edit Issue action with the source as Copy from Parent.

If that will not work, you can use the advanced edit functions using JSON.  Here is some information on how to do that:

https://support.atlassian.com/jira-core-cloud/docs/advanced-field-editing-json/

Unfortunately the team field still isn't updating. Here's the code I'm using to try and pull the Team field from its parent issue. The automation will run but the field is still not updating. Any suggestions?

{
"fields": {
"customfield_10800" : "{{ issue.epic.customfield_10800.asJsonString }}"
}

A couple of more ideas to try:

Please try some log messages to learn what is in the custom field of the parent and child.  Perhaps you need to specifically use something like the following to access the information {{issue.customfield_10800.value}} or .name

Next, I haven't used the syntax of {{issue.epic...}} to access the parent issue's data.  You could try a branch on the parent to access the field instead.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
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,853 views 37 48
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