How to check values of field in workflow?

Josef Sigl May 16, 2024
  • I've a field (typ: Chekbox) and we use it currently only with 1 selection.
  • Now I'd like to give it more selectios, but it shall be select only one of them.
  • Ich want to make it in workflow with an check and if the user select more than one, he should get an error Message!
  • How can i do this? We use JMWE app

regards
Josef

2 answers

1 accepted

1 vote
Answer accepted
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.
May 16, 2024

Hi @Josef Sigl 

using JMWE, you can create a Scripted (Groovy) Validator with a script like:

issue.get("my checkbox custom field name or ID")?.size() == 1
Josef Sigl May 16, 2024

hi david, i'll try it and giv you feedbck - thx

Josef Sigl May 17, 2024

Hello David, i've done as you told, but it does'nt work. I get an error message - please look at the screenshots

 

image.pngimage.png

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.
May 17, 2024

Hi @Josef Sigl 

please replace the script with:

issue.get("customfield_10375")?.size() == 1
Josef Sigl May 17, 2024

Hi David, it works !

thanks a lot

image.png

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.
May 17, 2024

Hi @Josef Sigl 

I'm glad it worked.

Can you please "Accept" the answer so that others can benefit from it?

Thanks

Josef Sigl May 21, 2024

Hello David, unfortunately it doesn't work perfectly ;-/

This error message should only appear, if someone enters 2 values. If someone enters only 1 value or no value, there should be no error message.

image.pngimage.png

Do you have an idea how I can solve this?

regards

Josef

 

 

Josef Sigl May 21, 2024

Hello David, I've already found the solution.

issue.get("customfield_10375")?.size() <= 1

It works ;-)

regards

Josef

1 vote
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2024

Hi!

If you only want 1 selection to be possible, why not use Radio button type control?

Jeroen

Josef Sigl May 16, 2024

Hello Jeroen,

the field exists for a long time and I don't want to create a new one, because all queries inklude this field would no longer work.

So I'd like to regulate this with an Validator-check

Regards

Josef

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events