Adding multiple conditions to Issue transition in a JIRA workflow - RESOLVED

Prashant Deshmukh July 18, 2018

Hi,

  I am trying to enforce some conditions for transitioning a JIRA issue in a workflow.

I have following transition steps in a Workflow named BugWorkflow

1. Open

2. In Progress

3. In QA

4. UAT

5. Close

I have several fields in my Bug Issue scheme. I want to check conditions on following non-mandatory custom fields a) SVN version b) Front End Code Reviewed c) Back End Code Reviewed

 

Here is what I want to do, When someone tries to transition a JIRA issue from UAT -> Close

I want to check

If SVN version field is empty - >Close the issue

Else check 

If ( Front End Code REviewed is Empty OR BackEnd Code Reviewed) ->Close the issue

 

I know that I can add single condition but this is a bit complex. If you have any solution, please let me know

Thanks 

Prashant 

 

 

1 answer

1 accepted

1 vote
Answer accepted
Sreenivasaraju P
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.
July 18, 2018

conditions.PNG

You can use value field condition and add any level of grouped conditions. 

Prashant Deshmukh July 30, 2018

Hi @Sreenivasaraju P

Thanks. Sorry for the late reply, I have tried your solution but its not working for me yet. I wanted to compare both NULL and not null condition at the root level. 

If I can write some psudo code, I Here is what I am trying 

If( SVN == NULL)

{

  IF (Back End Code Reviewed == NULL OR Front End Code Reviewed == NULL)

   {

        Close JIRA issue

   }

}

ELSE IF (SVN !=NULL)

{

  IF (Back End Code Reviewed != NULL OR Front End Code Reviewed != NULL)

   {

        Close JIRA issue

   }

}

I am not able to put the second condition somehow.

 This image help you understand better.  Appreciate your help in this regard.

JIRA_Problem.png

Thanks

Prashant  

Prashant Deshmukh July 30, 2018

I could change this a bit but still not able to achieve the expected outcome. Here is how it looks now. I guess the external nesting (pointed by red arrow) is causing the problem. Do you see any solution?

Thanks

Prashant

JIRA_Problem2.png

Like Pavel Braun likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2018

I suspect it's because your nesting is not doing anything. 

At the top level, you have two condition groups joined.

The first group says "The field fixed in svn version # ... equal to null".  The second says "The field fixed in svn version # ... not equal to null".  As the join is "any", then you are going to find that every issue matches the joined condition.

Prashant Deshmukh July 31, 2018

Thanks, Nic.

I am not able to put IF and ELSE IF condition here.

All I care is, 

IF SVN# is null then at least one of BackEnd code reviewed and FrontEnd Code reviewed fields should be blank

ELSE IF SVN# is not blank then

At least one of BackEnd Code Reviewed and FrontEnd Code Reviewed fields should not be blank

Let's say, if I put only one outer condition, SVN# is blank, then it is always going to make sure that the condition is true. I am not able to achieve IF ELSE IF condition here :)

Please suggest.

Regards,

Prashant

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2018

If/then are another way to express the logic, they don't do much different.

A set of conditions should lead you to a simple boolean true or false.  You can express them as if/then, or as and/or statements or a mix when you're coding, but for conditions in Jira transitions, you have to use and/or.

Look at the second layers of nesting in your conditions - they should be "and", not "or"

Prashant Deshmukh July 31, 2018

Thanks, Nic,

I will try and let you know 

Prashant

Prashant Deshmukh July 31, 2018

@Nic Brough -Adaptavist- It worked :)

I have changed the conditions and now I am getting the expected result. Here is what I have changed based on your reply.

I thank you both @Sreenivasaraju P and @Nic Brough -Adaptavist- for the help.

JIRA_Problem3.PNGNext: I want to display the error notifications to the user when the conditions do not allow to close the issue. 

Suggest an answer

Log in or Sign up to answer