Checkboxes options as required

SRIDHAR
Contributor
August 9, 2012

I have a checkbox custom field and it has 5 options. I want all the 5 options to be required. How do I make sure the user has selected all options before submitting the form. How do i make all the options as required ? All we have now is a field as required but how do we make the options as required ?

2 answers

1 accepted

0 votes
Answer accepted
SRIDHAR
Contributor
August 13, 2012

Solution and I fixed it.

Created a validator in workflow on create issue. Used built in script runner to check a customfield checkboxes values. All the checkbox field is required field. All the checkboxes need to be selected to create an issue.

cfValues['Please acknowledge'][0].getValue() == 'option1'
cfValues['Please acknowledge.'][1].getValue() == 'option2'
cfValues['Please acknowledge'][2].getValue() == 'option3'
cfValues['Please acknowledge.'][3].getValue() == 'option4'


Thank you for your suggestion.

0 votes
Nic Brough -Adaptavist-
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.
August 9, 2012

You'll need a validator to do that in workflow.

The standard "mandatory" field stuff will accept any one (or more) options being selected as "this has been filled in".

SRIDHAR
Contributor
August 12, 2012

I tried to add a validator on create issue and mentioned by conditions as

cfValues['Please acknowledge'][0] == 'Yes'
cfValues['Please acknowledge.'][1] == 'Yes'
cfValues['Please acknowledge'][2] == 'Yes' cfValues['Please acknowledge.'][3] == 'Yes'

It validates the checkboxes but it won't let me create the issue. I am getting the error message when i click create issue button , please select all the checkboxes .
What am i doing wrong. Please help me out.

I see this message in logs
2012-08-13 13:06:38,785 TP-Processor8 ERROR user 786x13496x1 16q0vol 10.203.201.222 /secure/QuickCreateIssue.jspa [groovy.canned.utils.ConditionUtils] javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getAt() on null object
2012-08-13 13:06:50,159 TP-Processor9 ERROR user 786x13497x1 16q0vol 10.203.201.222 /secure/QuickCreateIssue.jspa [groovy.canned.utils.ConditionUtils] javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getAt() on null object
2012-08-13 13:07:56,377 StreamsCompletionService::thread-1607 WARN anonymous com.atlassian.streams.internal.ActivityProviderConnectionMonitorImpl:activityProviderMonitor [atlassian.streams.internal.AppLinksActivityProvider] Unable to retrieve filter options from /rest/activity-stream/1.0/config?local=true

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events