Forums

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

Auto transition a sub task

darren.johnson September 17, 2021

Hi,
I have set up a rule to auto recreate a task and sub task within the parent task, I would like the sub task status to transition to planned in line with the Parent task how do I do this please ? I am using Team Managed next gen.

image.png

2 answers

2 accepted

1 vote
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.
September 17, 2021

Hi @darren.johnson 

I believe you do this with the same technique of branching on created issues, but alter your rule to guarantee the sub-task(s) are created first by changing the first branch.  For example:

  • trigger: same as you note
  • condition: same as you note
  • action: create task issue, same as you note, and also setting the epic link in this step
  • branch: on JQL of key = {{createdIssue.key}}  This branch will have one-and-only-one issue, and so execute in-line
    • action: create sub-task, same as you note
  • branch: on all created issues (this will now include the task and sub-task
    • action: transition to Planned

Kind regards,
Bill

darren.johnson September 17, 2021

Followed those steps and afraid it does not work, it falls over on the JQL step, is there another way of doing this without using the JQL step ?

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.
September 17, 2021

Darren, when you note it falls over on the JQL step, what do you observe happening and what do you see in the audit log?  Thanks!

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.
September 17, 2021

Sorry; my bad...it appears to be a bit more complicated as I just discovered...

{{createdIssue}} and {{createdIssues}} do not appear to return sub-tasks created in a rule!

So here is the work-around for this which I tested and believe works as you asked:

  • trigger: issue transitions to Completed
  • condition: check if summary contains your value
  • condition: check if issue type is Task
  • action: add the new task, copying the fields you wish
  • action: transition the issue to Planned
  • branch: on Most Recently Created Issue
    • action: add your sub-task
  • branch: on JQL with issuetype = Sub-task and parent = {{createdIssue.key}}
    • action: transition the sub-task to Planned
darren.johnson September 20, 2021

Sorry but I am finding your instructions really hard to follow, are you able to take a screen shot of your example created please as I can't get it to work.

I don't know what the below means or how to create it, I am new to JIRA.

  • branch: on JQL with issuetype = Sub-task and parent = {{createdIssue.key}}
    • action: transition the sub-task to Planned
darren.johnson September 20, 2021

image.png

image.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.
September 20, 2021

Hi Darren,

It appears you have a typo in your JQL for the branch.  Here is an image of my test rule to do what you asked.

Kind regards,
Bill

create and transition parent and child.png

darren.johnson September 20, 2021

@Bill Sheboy Thank You however I still can't get it to work so just going to leave the sub tasks as new request status, when I enter the JQL it won't let me validate it, the validate button is greyed out, If I run it exactly as you have advised and it does not work the sub task stays as New Request so just going to leave this now I think. Thank You anyway unless you can expand the JQL branch showing me it has been validated and screen shot that for me.

Also just checking your doing this in Team Managed Next Gen ?

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.
September 20, 2021

I tried this for team-managed and company-managed.

That JQL references a smart value, so you cannot validate it in the rule at design-time (which is why the button is grayed out):

issuetype = Sub-task and parent = {{createdIssue.key}}

We have extra issue types in our instance, so perhaps also check what the name of your issue type is for a "sub task".  You may confirm this by running an example of that JQL stand-alone in advanced filter search, such as:

issuetype = Sub-task and parent = DGOV-424

I believe that was one of your tasks, correct?

0 votes
Answer accepted
darren.johnson September 21, 2021

@Bill Sheboy you cracked it Thank You, it was the hyphen in Subtask that was causing the issue.

image.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.
September 21, 2021

Awesome!  I am glad to learn you got it to work.

__Bill

Suggest an answer

Log in or Sign up to answer