Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to configure a workflow transition based on multiple conditions?

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

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

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." 

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

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")

Hi @David Fischer _Appfire_ ,

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
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

116 views 1 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you