how to make the field required if checkbox is selected

Darya_Koyfman January 5, 2016

I need to be able to make the field required only if the check box is selected.

3 answers

1 vote
Phill Fox
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 5, 2016

Hi @Darya Koyfman

This could be implemented using a scripted validator on your workflow transition. Where the check is done on both the checkbox and the field to ensure that both or neither are filled in.

0 votes
Darya_Koyfman January 5, 2016

Hi Steven, 

I will try to play with that. 

Thank you!

Steven F Behnke
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 5, 2016

It's an Adaptavist add-on, they are usually willing to provide troubleshooting advice here on Atlassian Answers, nice guys like Phill here. :)

Phill Fox
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 5, 2016

@Steven Behnke Thanks for the plug for Adaptavist. @Darya Koyfman You may like to look at the supporting documentation for Scriptrunner at https://scriptrunner.adaptavist.com and in particular https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/conditions/simple-scripted-condition.html for some examples of the power of ScriptRunner.

0 votes
Darya_Koyfman January 5, 2016

Hi @Phill Fox [Adaptavist]Thank you for your quick answer. I need to be able:

  1. If the check box is checked, then one of the field becomes "Required". If it is not, then that field doesn't have to be Required.
  2. I checked all scripted validators on my workflow transaction, and none of them fits to this. I am not a programmer anymore (especially Java), I am JIRA administrator and I create engineering processes.
  3. So, I need a script itself, if it is possible.

    Thank you in advance!
Steven F Behnke
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 5, 2016

Customizing the product has always been part of JIRA. You're not going to find anyone who will perform that work for free. If you're interested in the typical methods, most people use the Script Runner add-on to write a transition validation script as Phill noted or use javascript through Script Runner Behaviors. The most permanent solution would be to write a JIRA Connect Validator or a JIRA Plug-in Validator, as these are the ONLY methods Atlassian recommends besides add-ons like Script Runner.

Steven F Behnke
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 5, 2016

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events