How to configure a workflow transition based on multiple conditions?

Gil Vinokoor January 11, 2021

Hello,

I am trying to figure out how to conditionalize a workflow based on a subset of projects with a subset of custom field values.

For the sake of this example, there are 2 projects using the same workflow, custom field, and custom field values.

1. The projects are: A and B.

2. The workflow is: To Do > In Progress > Done

3. The custom field is: Demo

4. The custom field values are: Yes and No and EMPTY (default)

I would like to enable a condition whereby:

- user can move issue in project A from In Progress to Done regardless of the custom field value (i.e. can equal Yes or No or be EMPTY)

- user can move issue in project B from In Progress to Done only if the custom field value equals Yes or No (i.e. cannot be EMPTY)

Does anyone know of a way to implement such a condition?

I have the following apps to use: Scriptrunner, JMWE, JSU.

2 answers

1 accepted

0 votes
Answer accepted
Kinnera Siriki (Appfire)
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.
January 11, 2021

Hello @Gil Vinokoor 

We have raised a request in our Beecom portal to provide quick support and to track the progress of the ticket. Please register in our portal and access the ticket using this link: https://beecom-products.atlassian.net/servicedesk/customer/portal/3/JSU-3179.

And to answer your question, yes you can achieve this requirement using JQL Condition(JSU). Edit the workflow and on your transition configure the conditions as below:

As per your example, we are considering the projects as A and B and assuming the custom field named Demo to be of type Radio Button

JQL for the first requirement:

project = "A" AND key = {issue.key} AND ("Demo" in (No, Yes) OR "Demo" is EMPTY )
  • Number of Issues found: Must find issues

JQL for the second requirement:

project = "B" AND key = {issue.key} AND ("Demo" is NOT EMPTY ) 
  • Number of Issues found: Must find issues

    Please select Any of the following conditions from the dropdown before you publish the workflow. Perform a transition and see if this works for you.

    For Project A, the Done transition will be visible irrespective of the Demo field value and for Project B, the Done transition will be visible only when the Demo field has value in it.

Please let us know if this helped you in achieving your requirement or not!

 

Regards

Kinnera

Gil Vinokoor January 14, 2021

Hi @Kinnera Siriki (Appfire),

Thank you for the detailed and helpful response.

This is exactly what I was looking for and did the trick, so thank you!

With that, if you know of/can think of a way to visually inform Project B users why the close/done transition is hidden, and what they need to do to have it appear, that would be helpful too.

Gil

P.s. Despite registering in the portal, when I clicked the link I got an error message, "No Access. You do not have permission to view this request." 

Kinnera Siriki (Appfire)
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.
January 14, 2021

Hello @Gil Vinokoor 

We have marked you as a reporter for the ticket https://beecom-products.atlassian.net/servicedesk/customer/portal/3/JSU-3179 in our portal and now you'll be able to see the updates from the ticket.

In the future, if you have any issues please feel free to submit a new ticket. We are always happy to help you!

Best Regards

Kinnera Siriki

0 votes
David Fischer
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 11, 2021

Hi Gil,

with JMWE for Jira Server/DC, you can add a Scripted (Groovy) Validator to the Done transition with the following script:

issue.get("project").key == "A" || issue.get("custom field")
Gil Vinokoor January 14, 2021

Hi @David Fischer ,

Thanks for replying with a suggested JWME script.

I'm less familiar with scripting and didn't fully understand how to implement my use case based on what you wrote.

Fortunately, another answer was provided that helped did the job. 

Thanks again for trying to help.

I'm sure there will be more opportunities for that in the future. ;)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events