Copy form from trigger issue to created sub-task
Asked by Marc - Devoteam:

Hi all,

I have a challenge. I have a request type on a portal with a form.

Based on values set in the form there is an automation that creates sub-tasks from the selected options.

These selected options are based on a Jira custom field, also based that multiple options can be set I branched the rule so that based on the options selected a sub-task is created.

![4189f5e5-776e-4c24-ab01-5d173c791939.png](https://community.atlassian.com/t5/image/serverpage/image-id/332370i9096717A42EFCBDE/image-dimensions/292x458?v=v2 "4189f5e5-776e-4c24-ab01-5d173c791939.png")

This is all working fine.

Here is the challenge, I want to have a copy of the form on each of the sub-task created.

I have tried to do an issue lookup after the branch, I looked up the sub-tasks created. These I can slo find, but then I made another branch based upon the lookup and using the key of the found sub-tasks and then have an action to copy the form based on the trigger issue.

![Screenshot 2024-06-28 at 14.11.28.png](https://community.atlassian.com/t5/image/serverpage/image-id/332373i5A9E34C54E83BAC6/image-dimensions/359x402?v=v2 "Screenshot 2024-06-28 at 14.11.28.png")

But the log always comes up with no form to copy, all issues are in the same project.

Any ideas here in the community?  

Thanks in advance.


Answers:
author: Bill Sheboy
body: Hi [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976)

I am guessing a bit here as I cannot see your entire rule in one image, and...

The problem is likely because you are using two branches in the rule and assuming the first completes before the second one.

Branches which could be on more-than-one-thing are run in parallel and asynchronously, and there is no guarantee of when the branch will complete, up until the last step of the rule. For your scenario, this means the first branch is still running when you try that Lookup Issue action and when the second branch starts running.

A possible workaround for your scenario is to use two rules:

* first rule adds the subtasks
* the second rule...
  * enables the option in the details "Check to allow other rule actions to trigger this rule..."
  * triggered on issue created
  * adds lots of conditions to ensure this is a subtask, and has the other criteria to decide when to proceed
  * copy the form from the parent issue

Kind regards,  
Bill

comments: author: Marc - Devoteam
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

It's in fact the complete rule. The 1st part is the initial rule and the 2nd part is what I added.

An I do agree in your thinking that it relates that branched run in parallel and they run asynchronously.

I tried to see if anyone had a solution, as I know you can juts create sub tasks one by one in a rule and then brach with the lookup. But then I wold have to create 5 rules instead on the one I have now, due to the options that can be selected in the form.

I will take a look at your suggestion this week and see if this will do the trick.

Thanks for looking and the suggestion.


author: Marc - Devoteam
body: Hi Bill,

This solution works. I had to think about this myself!!!


author: Nicolas Grossi
body: [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) Maybe this is helpful for you: <https://community.atlassian.com/t5/Jira-Service-Management/Jira-Automation-Creating-Subtasks-and-Copying-Values-from-Parent/qaq-p/2001391>

HTH

Nicolas

comments: author: Marc - Devoteam
body: Hi [@Nicolas Grossi](/t5/user/viewprofilepage/user-id/676185)

Thanks for the suggestion.

This Article I have seen and is the basics, if I would implement this I would have to transform my branch from one rule to 5 rules.

The form in the request has many options to choose from, so this I wanted to circumvent.

Thanks for the reply anyway.


Tags: cloud

forms

jira

jira-service-management

jira-service-management-cloud

smart-value