Forums

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

Is there a way to check both at the same time subtasks status and No-Subtasks?

Julien Goudeaux March 21, 2022

Hello there 👋🏼,

So I have a trigger when the PR is merged

Then I check the type of ticket and current status to see if I can transition it (we have a guided workflow).

 

When I enter the Else-if part, and if the issue has no subtasks, the condition fails and then doesn't make the transition. And as we can't set an if-else inside an other if-else, then I would like to know the solution to have in the For Current Issue the possibility to check if NO subtasks or ALL DONE

 

For now I have these 2 separated blocks of FOR CURRENT ISSUE that I would like to merge in 1. 

 

Thank you :) 

 

Screenshot 2022-03-21 at 13.11.09.png

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Champion
March 21, 2022

Hi @Julien Goudeaux and welcome to the community,

Your rule shows 2 branches within the same "decision" path. The 2nd branch could never be reached as the rule will break as soon as the condition of the first branch don´t match. That´s what an if-else-clause is for:

  •  if
    • (in your case branch 1)
    • 1st condition matches
    • do abc
  • else
    • (in your case branch 2)
    • as 1st condition doesn´t match
    • do xyz

 

referring to your rule this could look like similar to this (don´t have the same workflow so status has to be editted to yours):

image.png

Best
Stefan

Julien Goudeaux March 22, 2022

Thank you for the answer @Stefan Salzl ! 
Yeah it will work this way but I wanted to avoid duplicating stuff! 

This is why I was asking if it was possible to have an only one IF where I can say AND and OR like :

- status = something

AND

- TestRoom = Something

AND

- subtasks ALL = something OR No subtasks

 

Stefan Salzl
Community Champion
March 22, 2022

Those are basically contrary concept:

AND - all of the conditions met and resulting in one action

OR - at least one of the condition matches and has a dedicated result

IF/ELSE - either one or the other condition matches and a dedicated result regarding which of the conditions matched

Julien Goudeaux March 22, 2022

Sorry @Stefan Salzl  maybe I'm not asking it correctly and it's not clear enough! 
I'm an iOS developer (while I'm scrum master of my squad)! 
So I know the IF/ELSE - AND - OR concepts! 

What I see is that the If/else block is either a success (all conditions succeed) or a fail (at least one has failed)! 


But what I wanted to do (if it's possible) would be something similar to:

If status = "Code Review" AND TestRoom is Empty AND (subtasks match status = Done OR subtasks not present) 

  Then transition to Testing

Else If status = "Code Review" AND TestRoom = "Not Needed" AND (subtasks match status = Done OR subtasks not present) 

  Then transition to To Deploy

 This is the tricky part in the parenthesis of my Else If that would allow me to have 2 big conditions (If/else) instead of 4 to test one time with subtasks done and an other time with no subtasks!

Stefan Salzl
Community Champion
March 22, 2022

ok. I see :) not everybody in hear is a developer and knows about the differences. In this case my explanation was unnecessary.

The point is that the part in the paranthesis checks 2 different „entities“: once presence of subtasks vs. status of subtasks (even further entities that depend on each other which even consits of another „if“ - the second „if“ (status) can only be checked if first condotion doesn‘t match). Within jira I see the OR realized in consition „is one of“ which will only take 1 input (eg. status is one of ...).  As far as I know by chaining 2 different entities (especially checking 2 different combinations) this won‘t fit in an OR clause (at least not in A4J). 

What would be the differene in your test? From my point of view the result of the automation rule is tested. As the use case doesn‘t change the testcases would stay the same. Only the „how it‘s implemented“ changes.

Suggest an answer

Log in or Sign up to answer