Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,455,547
Community Members
 
Community Events
175
Community Groups

Cloning Epics including stories - Jira Automation

Edited

I found a solution that is working for some folks but not for me.  Any suggestions?  I'm using Jira Cloud.

This clones everything that is linked directly to the epic. You could define the same rule-logic for the story-subtask relation ship.

2021-11-05_17h47_20.png

 

Details of "Clone" Block:

2021-11-05_17h49_27.png

 

If you are using Jira Premium you can also use "portfolioChildIssuesOf" to gather the tickets inside the epic which would also fetch sub-tasks.

However now you need to pay attention that your Automation does not try to link cloned subtasks to the new epic.

2 answers

1 accepted

1 vote
Answer accepted

This works for me:

1. Run when issue linked via "Cloners"

2. Condition: only if the issue type is Epic AND it's linked "is cloned by" - meaning the issue you just cloned

3. Scriptrunner query to get the issues in the Epic linked to the Epic that was just cloned

issuefunction in issuesinepics("issuefunction in linkedissuesof(\"key = {{triggerissue}}\",\"clones\")")

4. Clone issues in Epic and set the Epic Link to the Trigger issue

5. Delete the issue link "clones"

 

Screen Shot 2022-10-13 at 4.16.25 PM.pngScreen Shot 2022-10-13 at 4.19.31 PM.png

Trudy Claspill Community Leader Oct 14, 2022

Hello @Marc 

"issueFunction" is not native to Jira JQL. Your solution requires a third party app. Are you using Adaptavist Scriptrunner?

Yes, Scriptrunner is required in order to use that JQL function.

0 votes
Trudy Claspill Community Leader Mar 11, 2022

How is the solution not working for you? What problem are you encountering?

It simply doesn't work....the Epic clones but no stories.

Trudy Claspill Community Leader Mar 14, 2022

Can you provide a link to the post where you got this suggestion?

I think the problem is in the branch "For JQL" where it says

"Epic Link" = {{destinationissue}}

Reviewing the information for the trigger I understand it to be saying that "issue" would be the source issue (the Epic you are cloning) and "destinationissue" would be the resulting Epic generated by the clone action. So, if you want to clone all the child issues in the source Epic then I think the branch should be

"Epic Link" = {{issue}}

I haven't tested this Automation myself, so this is just based on a desk check.

Here is the original link:

Cloning Epics including stories - Jira Automation (atlassian.com)

Here is the audit log from the automation - MT-30 is the Epic being cloned and MT-48 is the clone:

Action details:
Issue linked
Destination issue (to perform actions on this issue use a 'Related branch', you can also access it via {{destinationIssue}}):
MT-30
Source issue (the main branch of the rule will execute for this issue and you can access it via {{issue}}):
MT-48
JQL condition
The following issues did not match the condition:
MT-48
This may be due to any of the following reasons:
the issue didn't match the specified JQL (most likely)
the chosen rule actor doesn't have permissions (or issue security level permissions) to view the issue
the issue was deleted or wasn't indexed by Jira yet (in rare circumstances)
We recommend using the 'Issue fields condition' for more consistent results.

Trudy Claspill Community Leader Mar 15, 2022

Hello @Kurt Smith 

The link you provided is to this post. I am interested in the original post where you got the information about this automation.

You said MT-30 is the epic being cloned. So that Epic already exists. And when you cloned it, you say that MT-48 was created? That doesn't make sense as the numeric part of the issue key should be incremented and the newly created Epic should have an issue key with a numeric value greater than 30.

I created this rule in my own environment in a Company Managed project. I selected an existing Epic that had one child issue, and selected the Clone action from the ... menu. The rule worked correctly, creating a new Epic and creating a child under that new Epic that was a clone of the child issue under the original Epic.

I also tried manually creating a new Epic, then manually linking it to an existing Epic using the "clones" link. In that case also the child issues of the existing Epic were cloned and made children of the new Epic I had manually created.

So, I'm not sure why the rule is not working for your instance.

@Trudy Claspill 

Can you please provide the automation you used to clone an epic and its child(ren)? Thank you.

Trudy Claspill Community Leader Oct 29, 2022

@Apryl Harris 

When an Epic (B) is created by cloning an existing Epic (A), this rule will then clone the child issues of (A) and make the new issues children of (B)

  • This works only for a Company Managed project.
  • This does not include cloning Subtasks of the child issues being cloned in this rule.
  • This does not require ScriptRunner.
  • This does not work when an Epic in a Team Managed project has been cloned.
TRIGGER: Issues Linked
- Link Type: Cloners
CONDITION: Issue field condition
- Field: Issue Type
- Condition: equals
- Value: Epic
BRANCH RULE/RELATED ISSUES: JQL
- JQL: "Epic Link" = {{destinationIssue}} order by key asc
ACTION: Clone Issue
- Project: Same Project
- Issue Type: Same issue type
- Fields to set:
- Summary: {{issue.summary}}
- Epic Link: {{triggerIssue}}
ACTION: Delete Issue Links
- Link Type: is cloned by
ACTION: Edit issue
- Fields to edit:
- Epic Name: {{issue.key}}

 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events