Using Automation for JIRA is it possible to transition the parent when all subtasks are resolved?
This is definitely possible using the related issues action and condition:
Lets break this rule down:
Hey Andreas,
Just expanding on this a little bit... I use multiple different subtask types. Is this powerful enough to differentiate? i.e. I can pick the subtask type I want to compare and then trigger a parent transition (and or do this via a filter searching for those subtaskIssueTypes())?
If so, that's incredibly powerful for me!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Russ,
Yes you can certainly do more filtering. We don't support else statements yet, so right now you'd have to setup multiple rules.
In the rule shown above you'd simply insert another condition before the "Then: For Parent" action. You could use a JQL condition for example to test "type = myspecialsubtasktype" (or any JQL really). If the sub-task that was transitioned matches then the rule will continue and transition the parent. If it doesn't then rule execution will stop.
You can also add more conditions in the "Then: For Parent" branch to for example only transition the parent if it is of a specific type/JQL match.
Setting up multiple rules is simple - you can just got to 'Create rule' -> 'Copy rule' to copy an existing rule if you just want to change the condition. We'll add proper 'else' support in future but for now this should work as well.
If you can describe a more specific example I'm happy to provide an example rule as well.
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Andreas,
Thank you for the reply, it's massively useful. Here is a full on use case:
1) I have multiple subtasks (i.e. Dev Task, Test Task, Documentation)
2) Each has it's own workflow
3) Parent's have their own workflow
Use Case:
Update Parent from Waiting for Dev to In Dev when any Dev Task is not new
Current thought: One automation rule that says Transition Parent to In Dev when JQL filter says dev tasks status is not new
Update parent to waiting for test when dev tasks are closed
Current though: another rule that says transition parent to Waiting for Test when JQL filter says all dev tasks closed
I guess the bit I find a little tricky right now is iterating over multiple subtasks to say 'all in status' .. but it looks like there's a rule in the compare bit that does this.. Could you help clarify this for multiple different task types? Just multiple rules?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Russ,
So you can do this as separate rules, or you can do it in a single rule as well. Here's an example:
transitionparent.png
So what I have is 2 related issues actions 'For parent' with a related issues condition that uses JQL to find all sub-tasks of a given type parent = {{ issue.key }} and type = "Dev-task" and then checks if some of them are in progress, or all are done respectively.
If some are in progress, I transition the parent issue to "In Progress". If all are Done I transition the parent issue to "Waiting for deploy" (in your use case this would be the "Waiting for test" status, but I didn't want to edit my workflow as well - you get the idea ).
Hope this makes sense!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey everyone,
Just letting you know that with the latest release of Automation for JIRA this is now a bit easier:
https://blog.codebarrel.io/better-transitions-and-simpler-scheduled-triggers-90b4b991b778
The improved Transition action now also supports smart-values and some special values like 'Copy from issue', 'Copy from Epic' etc.
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already mailed this to @Andreas Knecht, it's maybe useful for someone else who is looking for the answer:
My use case
I want to close User Stories when all Linked issues are closed. The difference with the example in this threadis that I have linked issues instead of sub-task. I thought it wouldn’t be a problem since the related issue condition supports Linked issues.
I have following test case set up:
When I transition HOR-939 to status Closed I see in the audit log that the flow triggers but returns an error. Maybe I misunderstand something in the JIRA architecture but:
Screen Shot 2017-02-02 at 11.20.50.png
My workflow
Screen Shot 2017-02-02 at 11.26.15.png
EDIT:
I tried the same with now using the concept of "sub-tasks" and it works fine. However I wonder if it would also work with "linked issues". Maybe my use case with linked issue fails because there is no "parent-concept" with linked issues?
EDIT2:
I managed to get it working with linked issues. Like I already mentioned in my first EDIT with linked issues there is no parent concept. I took a different approach in my automation flow:
Screen Shot 2017-02-02 at 18.24.36.png
Cheerio
Dimitri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Dimitri,
Nice work! Yes, for linked issues the 'Related issues' action needs to use 'linked issues'. The parent and sub-task options only work for those types of relationships.
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
Im trying to do something similar. above you wrote...
So what I have is 2 related issues actions 'For parent' with a related issues condition that uses JQL to find all sub-tasks of a given type parent = {{ issue.key }} and type = "Dev-task" and then checks if some of them are in progress, or all are done respectively.
I dont understand the part where you sday check if all are done. I dont see how you check if all the returned jql items are done. Im to the part where i can select my subtasks of certain type. But i dont see how to run the condition against the returned subtasks. Im probably overlooking something simple.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Phil,
So what you need is a 'Related issues condition'. It allows you to check if any, all or no issues match a given JQL.
See https://codebarrel.io/available-rule-components#related-condition
So you could use this to check if all sub-tasks of a given type match:
parent = {{issue.key}} and type = "Dev-task" and status = Done
Hope that makes sense!
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
maybe someone can help. I have a task with many sub-tasks. I need to transition task to status Closed once all sub-tasks are closed.
I reproduced the automation rule provided at the very beginning (Project automation - Code Barrel JIRA 2017-01-03 16-54-19.png 278 KB), but still that doesn't work. I get error: Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues:
API-942
Please advice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krystsina,
Can you post a screenshot of your rule showing the 'related issues' action configuration please?
You can also do this in support via https://codebarrel.io/support if you don't want to post your rule publicly here.
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krystsina,
This should work I think. Lets move this to https://codebarrel.io/support please - I don't want to dillute the question here with providing support.
Can you raise a support request please, and include screenshots with your audit logs as well, showing what went wrong?
Can you also include screenshots of the issue that was transitioned, showing its 'History' tab please?
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andreas,
I found an issue. It seems that in case you have transition 1->2->3 it won't allow you to automatically go from 1 to 3. You have to automate 1->2 and 2->3
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas
How do I know that the syntax for saying "issuetype = sub-task" is {{issue.fields.issuetype.name}} = Sub-task? How do I know that is isn't just {{issue.issuetype}} = Sub-task? Is there a syntax manual? I went through your documentation but I did not find an exhaustive list.
I can always use JQL, of course. But this mustache syntax has me curious.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Vrushali,
So https://codebarrel.atlassian.net/wiki/spaces/AUTO4J/pages/27656216/Smart+Fields is the best place to look for this currently.
It isn't an exhaustive list as you mentioned though. It's kind of hard to compile such a list, due to sheer number of different field types and field attributes available in Jira.
If in doubt I'd say use a JQL condition. We do have plans to make smart-values easier in the product in future through some sort of autocomplete (https://codebarrel.atlassian.net/browse/AUT-104).
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
I posted the following 2 questions as a comment on your Medium post but I just found this thread too so I'll paste them here as well.
I’m a new JIRA Core (Cloud) user and Automation for JIRA user. The “ Related Issues” condition looks pretty awesome and seems like what I’m looking for. I have 2 questions:
status in (Done,Closed,Resolved,myCustomDoneStatus1,myCustomDoneStatus2)
?Hope that my questions are clear enough. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jimmy,
I just posted a reply on Medium: https://medium.com/@kandreas/hi-jimmy-9d100c94bd2b?source=post_info_responses---------4----------------
Cheers,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! statusCategory = Done was exactly what I was looking for. I also didn't know there was an issue navigator, indeed very useful for building and testing JQLs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @andreas
I need your help
How can I do this automation in the opposite case? That is, when the history passes to the discarded state, all the subtasks (that were in progress) are moved to discarded and those that were in the backlog are eliminated?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please ignore my earlier message, I was able to figureout what was wrong. Its my mistake . This raises another question for me is that
Can we include multiple subtasks inthe "Second value" option of the if condition?
My end goal is, when someone creates a issue and transition to a 1st status, it needs to create multiple subtasks, and when all the subtasks are complete it should move to next status where another bunch of new tasks are created and when subtasks are closed again move to next status and so on.
I was successful in using automation for this and tested with one subtasks at one transition using this, but I would hate to create multiple conditions. I could use special string for all sub tasks and use contain option in if compare.
Just wanting to know what the best recommended approach/solution to achieve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
I am trying to achieve the same thing in question with no success. Attached is the rule, I am not sure if I am doing it wrong because from the first screenshot which andreas posted, mine doesnt look same
1. I could not find compare 2 values option but mine just says match 2 option
2. It doesnt let me add a new action of the parent at the same root after I used if statement
I am not sure if anything has changed with regard to the version I am using.
Please advise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I am struggling in automating to automatically close the parent if all linked issues via link type "Forwarded" are Resolved.
I've already tried with JMWE and Automation for jira but unfortunately without results...
Have somebody experience with that?
Any idea will be welcome
Thanks
Kind regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using Subtask (Test Executions) for Parent Use Test Cases
Automation seems to work and I receive notification but parent status isn't updated as soon as all subtasks are Passed.. seems to be a delay. I need to either refresh screen or exit to see the parent Use Test Case status updated to Passed.
Using this rule because testers forget to update parent when all tests are passed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.