Automation: Updating custom field (Team) on a new story to match its Epic field (Team)?

Isabella Musial
Contributor
February 7, 2025

Phoning a Friend! 

I have been trying to make this automation work for too many hours and need help! I know it can be done, but I am missing something. I found a bunch of examples, but none worked unfortunately! 

Steps: 

  1. Create a new story under an Epic where the custom field (Team) is already populated
  2. Upon creation, match that Team name with the parent issues' Team Name. 
  3. New story created and has the custom field (TEAM) filled out.

Sounds easy.. but I am STUCK! 

Screenshot 2025-02-07 133937.png

2 answers

0 votes
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2025

Hi @Isabella Musial ,

Below is my suggestion of how I'm currently updating the Team field at my end using Jira automation.

  1. Create a new story under an Epic where the custom field (Team) is already populated : I'm assuming this is the trigger, get the "id" of the Team that is stored in the epic. You can use the Smart values to access this value.
  2. Upon creation, match that Team name with the parent issues' Team Name. : Not sure I understand this, do you want to verify if the same team is filled out?
  3. New story created and has the custom field (TEAM) filled out. :  To map the Epic's Team to the child Story, use the value from the first steps in the below API (use the Send Web Request action here) : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put

Reference: https://developer.atlassian.com/platform/teams/components/team-field-in-jira-rest-api/

Hope this helps.

 

0 votes
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.
February 7, 2025

Hi @Isabella Musial 

First, your rule is branching to "Most recently created issue" but no issues are created during the rule; that is the purpose of that branch type.  The branch may be removed.

Next, your rule is referencing what appears to be a Created Variable by it has not been defined anywhere.

Assuming your "Team" field is customfield_10101, please try this:

  • trigger: Issue Created
  • action: Re-fetch Issue
  • condition: Issue Type equals Story
  • condition: Parent exists
  • smart values condition: 
    • first value: {{issue.parent.customfield_10101.id}}
    • condition: does not equal
    • second value: leave this empty
  • action: Edit Issue, using this JSON
{
"fields": {
"customfield_10101": "{{issue.parent.customfield_10101.id}}"
}
}

 

Kind regards,
Bill

Isabella Musial
Contributor
February 7, 2025

Thanks! I was hoping you would respond! 

Should I replace the team # with "id"

{{issue.parent.customfield_10101.id}}"

 

Isabella Musial
Contributor
February 7, 2025

Still not working - used the straight code and tried to replace with team # (4379)Screenshot 2025-02-07 143251.png

 

{{issue.parent.customfield_10101.id}}

 

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.
February 7, 2025

Please post an image showing the audit log details from trying to run the rule.

Also, have you confirmed that is the correct custom field ID for your field?

Like Isabella Musial likes this
Isabella Musial
Contributor
February 7, 2025

yes, customfield_10101 is correct. 

I tested on 2 different projects - neither inherited the Epic's team name.

Screenshot 2025-02-07 144419.png

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.
February 7, 2025

I just checked the public backlog and it appears copying the Team field with an automation rule using the Server / Data Center version is not supported yet:

https://jira.atlassian.com/browse/JIRAAUTOSERVER-159
https://jira.atlassian.com/browse/JIRAAUTOSERVER-779
https://jira.atlassian.com/browse/JIRAAUTOSERVER-1093

The JSON approach appears to only work with Jira Cloud.

Isabella Musial
Contributor
February 7, 2025

Well that is a drag! According to this, it can be done. 

https://community.atlassian.com/t5/Jira-articles/Automation-Set-your-Advanced-Roadmaps-Team-automatically-when/ba-p/1761588

We are technically in a cloud environment - but internally only .

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.
February 7, 2025

At that top of that article from @Walter Buggenhout , it describes it is for Jira Cloud.  There are comments asking about Server / Data Center, but no responses from anyone who got it to work.

 

I did find a knowledgebase article for Server / Data Center where setting the Target Start and End succeed with rules and JSON, but there is no mention of Team...which led me to search in the backlog :^)

Suggest an answer

Log in or Sign up to answer