Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to automate cloning a parent task to another project

Bonè Å October 14, 2021

I'm specifically trying to do the following:

When a subtask is assigned to me (parent task is assigned to someone else) > Parent task and subtasks are cloned to another project > Clones are linked.

 

I've set up this automation, but it won't complete due to the indicated issues. I don't know how to resolve those issues. Any ideas?

 

cloning issue.JPG

1 answer

1 accepted

2 votes
Answer accepted
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 14, 2021

Hi @Bonè Å -- Welcome to the Atlassian Community!

This is a global / multi-project rule, correct?  Please note that there are execution limits on running such rules, based on your license level.  You should be fine if you are on Premium but I expect you will have challenges if you are on Standard or Free levels.  Please check with your site admin to confirm your rule execution limits.

Next, you do not show the details of your clone actions, and that error seems to indicate that you are changing the issue type.  Is that correct?  If so, the clone inside of the parent branch should use the same type as the parent; to do this, please select the option "same issue type" and not "same issue type as trigger".

And...please note your condition test on other assignees is inside of a branch...that means the second clone will attempt to happen even when you don't want it to happen.  You can prevent that by moving the condition earlier, before the branch, and using the If (with JQL) or Related Issues to Parent with JQL to check the assignee.

Finally...your rule is a great start, and may need more logic based upon different parent/child handling in Jira.  When the trigger issue is a task, story, or bug, the parent is an epic.  So your rule could work with that second clone...But, when the trigger issue is a sub-task, you will need to add a sub-task instead.  I do not know if that is easily doable to clone a subtask *and* change the parent in a rule.

Kind regards,
Bill

Bonè Å October 14, 2021

Thank you for the reply!

To clarify, this is a single project rule.

I don't have the chops for programming or coding, I'm just a marketing lackey. Trying to figure out this software is difficult, so I appreciate your help.

I changed the issue type from "same issue type as trigger" to "same issue type" and it produced the following results: "no actions performed."

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 14, 2021

A single project rule cannot create issues in another project (without using the REST API, I think).  How are you selecting another project for the clones?

Would you please post an image of the Details section of your rule, from the very top of its definition?  Thanks!

Bonè Å October 14, 2021

I'm not sure how but I've been able to get it to automatically clone parent issues assigned to me to a separate project without problem, it's just trying automating cloning assigned subtasks when someone else is assigned the parent task that I can't get it to do.

Here are some pictures, hope they help.Screen Shot 2021-10-14 at 5.04.50 PM.pngScreen Shot 2021-10-14 at 5.05.09 PM.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.
October 15, 2021

Thanks, Kate.  Are these both Jira business projects, created from the templates?  I ask as I am trying to understand how that cross-project clone is working.

Bonè Å October 15, 2021

Yes, I believe the only type of projects we use are business projects.

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 15, 2021

I am waiting for an answer from some Atlassian folks about how Business Projects are different for automation, and until then...

Let's assume that business projects can create issues, without restrictions, in other projects.  It is not possible to create a sub-task and edit the "parent" with automation, but I think this can be worked around for business projects by copying the fields.

How about this rule as a new rule.  You can copy yours as a starting point, and disable your rule to avoid collisions.

  • trigger: issue is assigned
  • condition: assignee is you
  • related issue condition: parent issue is not you (This is not in your current rule.)
  • branch: on parent
    • action: clone issue (this copies the parent), changing it to the new project
  • if/else condition
    • condition: issue type equals subtask
    • branch: on JQL with key = {{createdIssue.key}}
      • action: create sub-task
        • This isn't exactly a clone...instead you will set each field you want to keep, such as summary, description, etc.
        • To set each field, use the trigger issue data, for example: {{triggerIssue.summary}}
        • To enter that value, you type it into the value, and when it appears below the field, select it to use the smart value
  • else
    • action: clone issue (this clones the child)...
      • when cloning the issue, select the new project and set the Epic Link field to {{createdIssue.key}}
      • To enter that value, you type it into the value, and when it appears below the field, select it to use the smart value
Like James Chan likes this
Bonè Å October 15, 2021

Hey that's getting somewhere! It cloned the parent task, which may be enough for me to work with. It didn't clone the subtask, though.cloning issue 1.JPGcloning issue 2.JPG

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 15, 2021

Progress!

And please note in your first condition in the if/else that seems to have an extra check.  Would you please post an image of that?

Next, after that first condition in the if/else is where you need another branch in order to create the sub-task.  Start looking here in what I provided above:

  • branch: on JQL with key = {{createdIssue.key}
Bonè Å October 15, 2021

cloning issue 1.JPGcloning issue 2.JPG

I don't understand what it means to branch on JQL with key, so I did my best.

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 15, 2021

You are very close to finishing it.  For the condition you show, please delete the JQL condition so it only has the issue type test.

I'll post a full example of the rule, with some extra details to help.  This is similar to your rule, except with my name and projects.

 

Capture 01b.png

For the related issues condition, we are checking if the parent has a different assignee, as shown below.Capture 02.png

Later we branch to the new parent, selecting the Branch on JQL option.  This branch allows adding a subtask to the new parent.

Capture 03.png

When creating the subtask, copy the fields from the trigger issue.

Capture 04.png

 

Then finally we handle the other case, where the child is not a sub-task.  Use clone  issue, copying the fields you need from the trigger issue.  When setting the Epic Link field, set it to {{createdIssue.key}}

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 18, 2021

Hi @John McKiernan 

Thanks for your other post, and I hope you are well also.

Here is the example I was mentioning about cloning issues, business project to business project without a global rule.  This does not seem to fit the cross-product reference you sent me.

Kind regards,
Bill

Bonè Å October 18, 2021

Thanks for explaining it so thoroughly!

John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2021

Hey @Bill Sheboy ,

Apologies for slow response. I wanted to get a little more depth from the Product Manager for automation. 

You can tell my automation skills are rusty as I was wrong in my initial response (other post).

With the Clone and Create actions - you can create issues in other projects (but still be counted as a single product rule). It's a bit of a workaround that I wasn't aware of. This is true for all Jiras, not just Jira Work Management.

Hope that helps and sorry for adding any confusion. 

Cheers,

John 

Like Bill Sheboy likes this
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 21, 2021

Thanks, John!  That is a good feature to know.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer