Automation to clone stories in an epic - for branch not working?

Jezza Sutton October 17, 2023

I am trying to write some automation to clone an epic and all the stories but the branching part of my automation is not finding any stores/tasks in the epic to clone. I've used by For: Stories in Epic as well as some actual JQL that ought to return tickets. I thought the original For: Stories was perhaps confused by which epic it was looking at and picking up the new cloned and empty epic. Hence trying the JQL.

If I can get this to recognize the tickets in the epic then setting the epic link should be easy. The problem seems to be getting the for loop to see anything.

 

Epic automation.JPG

5 answers

1 accepted

0 votes
Answer accepted
Jezza Sutton October 17, 2023

This appeared to be caused by restrictions/permissions set at the configuration level of the epic, which then got inherited by my epic I wanted to clone and somehow interfered with the For: Stories loop (or any other attempt to loop through this epic).

Here is a sample showing the difference running against the epic that inherited permissions (at 04:57) and the epic that was created after we removed the epic permissions/restrictions (04:47). 

Automation Logs working vs not working.jpg

Here is the automation in place, same automation run in both cases.

Working automation.jpg

Jezza Sutton October 17, 2023

Furthermore, changing the Actor from "Automation for Jira" to "User who triggered the change" means it works for the old epic too. Definitely a permission issue for the automation user.

0 votes
Luka Hummel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 19, 2023

Hi @Jezza Sutton

I'm Luka from codefortynine and if you further encounter any further problems with cloning your Epic hierarchy, you could try our Deep Clone for Jira. Deep Clone is able to clone whole issue hierarchies (Initiative ⇒ Epic ⇒ Task/Story ⇒ Subtask) with minimal effort thanks to our Epic/Tree Clone feature.Deep%20Clone%20for%20Jira_Epic%20Tree%20Clone-20230728-084919

0 votes
Jezza Sutton October 17, 2023

This has something to do with permissions on PENG, in my test project my automation works fine. Here is a sample of the audit log showing the for loop not detecting any stories/tasks in the epic. I am looking more closely at what restrictions were in place on things like epics and stories. The good news is my automation works. The bad news is I don't yet know what bit in PENG is messing it up.

 

Jira automation audit.jpg

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.
October 17, 2023

Hello @Jezza Sutton 

Can you show us the Audit Log output for an execution of the rule?

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.
October 17, 2023

Hi @Jezza Sutton 

Adding to Trudy's question:

Would you please show the action to create the variable oldEpic?  I suspect this may be where the problem exists.

Kind regards,
Bill

Jezza Sutton October 17, 2023

The For: JQL failed even when I specified the parent ticket directly (and verified it returns the records I want).  I will post what I now have working - the root cause appears to have been some restrictions applied at the configuration level of the Epic that the epic inherited. Since removing those restrictions, the automation works with new epics created since the change.

0 votes
Adam Rypel _MoroSystems_
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 17, 2023

Hi @Jezza Sutton ,

Are those stories from the same project as you have in scope = PENG? If not, then Automation might have trouble recognizing it, as the rule scope is not set to that project.

If that is not the case, could you use action Lookup issues, use the same JQL and then log variable {{lookupIssues}} to see if it returns anything?

Jezza Sutton October 17, 2023

Same scope, yes. I also tried using For: JQL and supplying parent = PENG-2652 to explicitly look up stories, which validates in my automation set up but does not work in actual running it.

Suggest an answer

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

Atlassian Community Events