Inherit Team field from parent issue using Automation

Bishop Justice November 24, 2020

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

3 votes
Answer accepted

I finally was able to solve it!

This would do the trick:

 

{
"fields": {
"team": "{{issue.epic.team.id}}"
}
}
Paul O'Shaughnessy July 29, 2021

Seems to work. Thanks

Bishop Justice July 29, 2021

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

Like Rik de Valk likes this
Nadav Movshovits April 10, 2022

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

Megan.Ruddock December 6, 2022

I've had the same problem. 

@Nadav Movshovits - Did you manage to get this to work for sub-tasks?

I can get the Sub-task to inherit the Team field from it's parent but the Team isn't displayed in the field.

I used the below for the Edit issue Action in my automation:

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

I can see the subtask has inherited the issue Team when I do a search, but on the UI the Team is not selected in the dropdown.  It still says 'None'.  

In addition I can't edit the Team field for a Sub-task

Paul O'Shaughnessy December 7, 2022

There's a bug for subtasks see: https://jira.atlassian.com/browse/JRACLOUD-76843   team names are inherited by not displayed

Megan.Ruddock December 7, 2022

Thanks @Paul O'Shaughnessy  

BTW - On further investigation is seems that an Automation isn't needed, because Sub-tasks will automatically inherit the Team from their parent.   Once the bug is fixed they should also be displayed :)

0 votes
andy.b June 29, 2022

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.

0 votes
Paul O'Shaughnessy May 20, 2021

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 

Bishop Justice May 20, 2021

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
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.
November 24, 2020

Hello @Bishop Justice 

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

Bishop Justice November 24, 2020

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

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2020

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

Bishop Justice November 30, 2020

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.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2020

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/

Bishop Justice November 30, 2020

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

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2020

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
AUG Leaders

Atlassian Community Events