Cloned Sub-task not copying proper Status

brandon.bradshaw@maritz.com January 8, 2023

My goal is for the Task and Subtask Status to get cloned over as well. My task Status changes correctly, however, the cloned Subtask Status is not cloning over correctly.

I have tried just about every Action/Condition within my For Sub-tasks branch but nothing will clone the Subtask Status properly.

Here's a drawing to further explain my dilemma.

Original Task (Status = To Do)
Original Sub-task (Status = To Do)

 -->

Cloned Task (Status = In Progress)
Cloned Sub-task (Status = To Do)

As you can see the Cloned Task status changes perfectly, but the Cloned Sub-task Status does not follow the workflow. The Cloned Sub-task should now have a status of In Progress.

Here is the only error I can find: 

Transition issue
Destination status could not be resolved. If using a smart-value ensure this resolves to a numeric status ID or untranslated name for issues (with current status):
Here you can see everything working except for the Sub-task transition. Ideally it starts out in TEMPLATE and lands in TO DO. The main task tranisitions just fine, just seems to be the sub-task that has the issue trasitioning.

SubTaskNotTransitioning.PNG


See this automation for additinal details on the automation: https://community.atlassian.com/t5/Jira-Software-questions/Clone-subtasks-with-Jira-automation/qaq-p/1321057

automation.PNG

1 answer

0 votes
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

Hi brandon.bradshaw@maritz.com 

Can you please clarify the logic for your full rule - is it...

  • Trigger: Issue Transitioned
  • Condition: Status = Template
  • Action: Clone Issue (Same Project)
  • Branch: Most recently created issue
    • Action: Edit Issue - Estimate, Labels
    • Action: Transition Issue - To Do
  • Action: Create Sub-tasks (for cloned Task)
  • Branch: Most recently created "Sub-tasks"
    • Action : Transition Issue - To Do

Note: I know this isn't strictly how it is in Jira, just trying to clarify how the whole rule works

---

A few questions:

  • Is the aim to clone a "Template Task" - which includes one Task, and multiple sub-tasks?
  • Is there a reason for not building the creation of the Task/Sub-tasks as a rule itself (i.e not needing to clone them)?
  • You mention the need to copy the Transition - but set them to "To Do" in the rule. Is the need to have Sub-tasks transition as the parent does (i.e a separate rule altogether)? If not, why are you setting it to "To Do" in the rule?

---

Understanding how the full rule works can help to clarify what might be missing here!

Ste

brandon.bradshaw@maritz.com January 8, 2023

Exactly that, the beginning trigger is actually a calendar schedule M-F. The automation works all the way up until my final branch For Sub-task where it seem to not transition the Status of the cloned Sub-task.

I made some notes below.

---

A few questions:

  • Is the aim to clone a "Template Task" - which includes one Task, and multiple sub-tasks? Correct
  • Is there a reason for not building the creation of the Task/Sub-tasks as a rule itself (i.e not needing to clone them)? I did not try that hmm. It's basically a recurring tasks only board Monday-Friday. The cloned task stays the same but get's a new date time stamp added each day M-F. Where would I implement this rule directly? I started the Templates workflow because then I could add tickets as they come and the automation rule would trigger all associated.
  • You mention the need to copy the Transition - but set them to "To Do" in the rule. Is the need to have Sub-tasks transition as the parent does (i.e a separate rule altogether)? If not, why are you setting it to "To Do" in the rule? I only set them to To Do to better understand the behavior. When I had the original Sub Task set to To Do in the Templates column, the clone sub task status would read Templates even though it's in the To Do column. Ideally the Task and Sub-task move as one from template to To Do.

---

 

Let me know what else I can eloborate on and if that helps.

Thanks for your time

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

Hi brandon.bradshaw@maritz.com 

So just to clarify the rule again:

  • There's a standard Template Task / Sub-tasks
  • It gets created each week, with Sub-tasks as days (Monday-Friday)
  • The Sub-tasks have a date/time stamp for each day - in due date? Or some other date field?
  • All issues should be in the status "To Do" - which is not the first status in the workflow

If this is correct, see below for a rule which does not require the template Tasks/Sub-tasks.

---

  • Trigger: Scheduled
    • Run Rule every = 1 weeks
    • On = Mon
    • At <Time / Timezone here>
  • Action: Create Issue
    • Project = <Project here>
    • Issue Type = Task
  • Branch: Related Issues
    • Type = Most recently created issue
      • Branch-Action: Transition Issue
        • Destination = To Do
  • Action (outside of Branch): Create Variable
    • Variable Name = newTask
    • Smart Value = {{createdissue.key}}
  • Action: Create Issue
    • Project = <Project here>
    • Issue Type = Sub-task
    • Parent = {{newTask}}
    • Fields...
      • Summary = Monday 
      • Due Date = {{now}}
      • ...etc
  • Branch: Related Issues
    • Type = Most recently created issue
      • Branch-Action: Transition Issue
        • Destination = To Do
  • Action (outside of Branch): Create Issue
    • Project = <Project here>
    • Issue Type = Sub-task
    • Parent = {{newTask}}
    • Fields...
      • Summary = Tuesday
      • Due Date = {{now.plusBusinessDays(1)}}
      • ...etc
  • Branch: Related Issues
    • Type = Most recently created issue
      • Branch-Action: Transition Issue
        • Destination = To Do
  • ...etc, for the other Sub-tasks

---

A few notes on this approach:

  • Rather than cloning an existing issue, the "Create Issue" field parameters would be set in each action
  • The Branch after each creation will reference the last created issue
  • The Variable can only be used in this rule, it's a temporary smart value
  • The Due Date is being set based on Monday + additional days - keep adding numbers to the (1) to go up to Friday (i.e (4)).

---

---

If the "Template Task" is the same each time, the above rule should work.

But if it isn't - and it changes each time (eg. new Tasks get created, and moved into the status "Template" to be automated) - you might need to keep your existing parameters.

So the rule might look something like this:

  • Trigger: Issue Transitioned
    • To Status = Template
  • Action: Clone Issue
  • Branch: Related Issues
    • Type = Most recently created issue
      • Branch-Action: Transition Issue
        • Destination = To Do
  • Branch: Relates Issues
    • Type = Subtasks
      • Branch-Action: Clone Issue
        • Issue Type = Sub-task
        • Parent = {{createdissue.key}}

^ As you have already seen, in this rule's scenario the problem is then transitioning the new Sub-tasks to "To Do" also. I tried a few different options using Advanced Branching, advanced field editing, etc - but I think it might need to be a separate rule

The rule might be...

  • Transition Sub-tasks to be the same as their parent (limiting this to cloned tasks, using a Condition)
  • ...or something similar

---

There are several requested features which would help with your need - I'd recommend voting for these / watching them:

  • AUT-335 - option to clone Parent + Sub-tasks
  • AUT-517  - this would allow you to create the Task + Sub-tasks and transition them all using the "All created issues" branch type

---

Let us know what you think!

Ste

brandon.bradshaw@maritz.com January 9, 2023

Sorry Stephan I'm probably making this more confusing than it needs to be. I appreciate all of your help so far. 


  • There's a standard Template Task / Sub-tasks. Correct
  • It gets created each week, with Sub-tasks as days (Monday-Friday). The Template Task get's created by the Label. M-F Label will create a ticket each day and timestamp it. For any tickets with a sub-task I will probably use the Monday Label so that the ticket is only cloned once a week but has one sub-task for each day of the week.
  • The Sub-tasks have a date/time stamp for each day - in due date? Or some other date field? Really only the Main Task needs the TimeStamp in the title, this works fine already.
  • All issues should be in the status "To Do" - which is not the first status in the workflow All issues should go from Template and land in To Do as they are cloned each day.



This board is strictly recurring tasks only. So if you have a task that happens everyday during the week you will add your task to the templates column and give it a label of M-F. My automation simply looks for the M-F label, copies that task and make a new ticket for it in the To-Do column and gives it a time stamp in the title of the ticket. This works perfectly.

We started thinking we may want to add sub-tasks to some of the recurring tasks. For example if one of your recurring tasks was checking an email inbox then maybe it wasn't necessary to have 5 tickets created during the week for that task. Simple to declutter the board. We figured there could be one task with 5 sub tasks. I am now realizing that this won't work completely with the current set up because the M-F label would still create 5 tickets instead of 1 ticket and 5 subtasks. However, I can make a second automtion for a Monday only label.

The core issue is setting the Status of the Sub-task. I believe if you could show me how to hard code or hard set the status field I could use something like this to complete my goal. Is there some sort of code or JQL I can put in this below that will set the Sub-task Status from Template to ToDoHowToUpdateStatus.PNG

brandon.bradshaw@maritz.com January 11, 2023

@Stephen Wright _Elabor8_ I believe I solved my problem by adding a second seperate rule. It would be nice to understand the JSON that could SET fields. But this works just fine. Thanks for your advice!

Rule.PNG

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2023

Hi brandon.bradshaw@maritz.com 

As I said above, I don't believe this is possible currently - but there are feature requests for it. You also can't set the Status using JSON as it's managed by a different action, "Transition Issue".

You do need the second rule to complete the transition of the Sub-tasks at this point.

Ste

Like Eric Jahn likes this
Eric Jahn January 9, 2024

How would one know if it's working from this example, because "To-Do" is the default beginning workflow status that cloned sub-tasks receive?

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2024

Hi @Eric Jahn 

You don't need to transition the issue if it remains in the first status post-creation. These additional details/rules are only needed if you're transitioning the issues straight away.

Edit: Answered on your new question.

Ste

Suggest an answer

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

Atlassian Community Events