Screen does not open on transition when I use a condition, validation required?

Seb August 24, 2021

I think I'm on the right track, but somewhere I have a reasoning error. I hope you can help me.

There is a status "New Upload" which can be set to "National Release" with the transition "Release". Everything is good so far. Clicking on the transition "Release" opens a screen containing two custom fields with the status "open" or "done". The Open and Done fields are both custom fields with a single choice.

Now to the problem.

I want the jump to "National Release" to only happen when both fields are set to "done". I tired to solve this with a condition, but the result is that the screen no longer opens.

That's why I think I have to solve this by validation and not with a condition.

But the expression does not work.

issue.customfield_10833 == 'done'

What am I doing wrong?

Many thanks in advance.

(I have the JMWE)

5 answers

0 votes
Seb August 31, 2021

 @Trudy Claspill 

Absolutely right. That was the solution. To check the selection field for the value "done", I have chosen the following function:

!!issue.customfield_10833 && issue.customfield_10833.value == "done"

Without "done" it does not continue as desired.

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 27, 2021

I don't use JWME but from reading the documentation this validator (Field Required Validator) is only for validating that the field is not empty, and the Validator Scope is to define when the field is required (i.e. field is required for issues of type Story). I don't think this validator is for validating that a field has a specific value. See

https://www.innovalog.com/videos/37-jmwe-cloud-videos/257-workflow-validators-for-jira-cloud

I think you should able to construct the right type of validator using the Build-your-own option, but I have not worked out the details.

https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/935362565/Build-your-own+scripted+Validator

0 votes
Seb August 27, 2021

If you want to give the user the option to meet the conditions in the Validator as part of completing the transition, then you add a screen to the transition to present the fields that the user might need to change to meet the conditions.

@Trudy Claspill 

Exactly, I have created a screen in which a custom field has the status "Open" or "Done". The transition should only be performed when the custom field is set to "Done".

But I can't get any further with the validation because the custom field with "Done" and "Open" is probably also a text field, i.e. a string. I don't know how to rewrite the function so that my intention works.

So funktioniert es auch nicht:

SharedScreenshot.jpg

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 25, 2021

Hello @Seb 

In what way is your validator not working? What symptom are you seeing that indicates it isn't working?

If you want to block the ability to try to change to a particular Status, you would use a Condition. The Conditions must be met or the specified Status will not appear as an option to select.

If you want to ensure that certain conditions are met as part of completing the transition, then you use a Validator. That allows the user to select the specified Status, and the Validator will check that the conditions are met when the user tries to save the status change.

If you want to give the user the option to meet the conditions in the Validator as part of completing the transition, then you add a screen to the transition to present the fields that the user might need to change to meet the conditions.

So, you are on the right track in using a Validator. Tell us more about how your transition is not working.

0 votes
Seb August 25, 2021

Does anyone have an idea? I can't get any further.

Suggest an answer

Log in or Sign up to answer