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

Automation to clone an issue into a different project and create a subtask in the cloned issue

Andrew Kwong July 11, 2023

Hi all, I'm trying to build an automation. 

 

Intent: When I raise a request in my portal, I want it to clone the new issue into a different project. I also want a subtask to be created within the cloned issue based on a certain parameter from the portal request.

Where I need help: I get stuck when trying to make the automation also create a subtask on the cloned issue. I've attached a screenshot of my current automation setup. In the audit log, I'm seeing that a subtask can only be created in the parent project.

I'm hoping that there's a workaround and hope that I'm not skipping any crucial steps. Thanks in advance!Capture.PNG 

1 answer

1 accepted

0 votes
Answer accepted
Himanshi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2023

Hello @Andrew Kwong , 

Welcome to the community!

If I understood your concern correctly you are getting error when subtask is being created :

"a subtask can only be created in the parent project."

Could you please share the exact flow of the request lets say You wish to clone an issue from Project A to Project B then want to create a subtask under the cloned issue(recently created). 

For this scenario I have an automation rule setup , sharing the snippet with you please try to tweak your automation rule accordingly:

Screenshot 2023-07-11 at 10.45.00 PM 1.png

Hope it would help

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.
July 11, 2023

Hello @Andrew Kwong @Himanshi 

I was just addressing the same question in another user's post.

Note that to use the automation provided by Himanshi the Automation Rule must be configured as a multiple-project rule with both the source and destination projects listed in the Project Scope. Without that, the branch for Most recently created issue will fail like this:

Screen Shot 2023-07-11 at 1.27.00 PM.png

A single project rule cannot operate against issues in other projects except in limited ways. It can Create an issue in another project and Clone an issue to another project, and create links between the current issue and the new issue, but it can't create subtasks under the issue that was created in the other project.

The alternative to making the rule a multi-project rule is to create another rule in the destination project that will create the subtask upon creation of the new issue.

Andrew Kwong July 11, 2023

@Trudy Claspill and @Himanshi - Thank you both for the insight here! Very helpful. I wish that I'd asked the community earlier!

Andrew Kwong July 11, 2023

One more question. So I've gotten the subtask to work. But on the request from project A, if the parameter that would trigger the subtask isn't met, I still want to clone the task. 

As in a pass/fail. Fail clones the issue and makes a subtask. Pass just clones the issue. I've added an extra component to account for the "pass" but it doesn't seem to work. Any  tips?Capture 2.PNG

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.
July 11, 2023

I am confused about the condition you are trying to apply.

Looking at the rule, the task will only be cloned if the trigger issue field "Did injury..." is set to Yes. Then the issue is cloned and the subtask is created.

Are you saying that if that field is set to No then you still want the issue cloned, but no subtask created?

If so, then move the condition from before the Clone action to after the Clone action (and before the branch). Then the clone is always made but the subtask will be created only when the field is Yes. The rest of the steps you have in the rule after creating the subtask are not needed.

Screen Shot 2023-07-11 at 2.43.21 PM.png

Andrew Kwong July 12, 2023

Thank you again!

Andrew Kwong July 13, 2023

Wondering if you can help again on something. I've successfully layered multiple subtasks to be created off of certain parameters in a portal form. Is there a way to make the subtask summaries and descriptions dynamic? As in pull in information from specific fields from within the portal form. 

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.
July 13, 2023

@Andrew Kwong 

That question doesn't seem related to the Automation Rule help you asked for in your post.

If it is a new topic, please start a new Question for it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events