Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to make sure that any of the value in checkbox selected in Jira

Mansi Patel March 28, 2018

Hi,

 

I am using "Checklist" custom field in Jira named "Agreement". and I have 2 options for that one: 

1) Agree

2) Read Later

Now, while creating issue I need to make sure that user has selected atleast one of them. 

I have set this field as required in field configuration but it doesn't validate that any value is selected. 

Also I tried checklist validator in "create issue" transition but it looks for all mandatory items, now I can't make any of them or both of them mandatory.

Also different validators like, field is not empty or field is required is also not working.

 

I am using Jira 7.7.2 version. any help is appreciated.

 

Thanks,

Mansi

3 answers

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2018

If you want to enforce only 1 selection why not just make it a select list, which by definition is only 1 selection?

Mansi Patel April 23, 2018

select list works technically but esthetically, Agree and Disagree should be checkbox. 

Scott Theus
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.
April 26, 2018

You could name the custom select list "Agree or Disagree?" and make it required. When the user drops down the list then the two options are shown. That would maintain the esthetics and keep the solution simple.

Otherwise you may need a JSOM script. I don't know how to write them yet, but I can picture the logic:

Set both checkboxes to "required"

Write a script that says "If Agree is checked then Disagree set to be not required. If Disagree is checked then Agree is set to not required,"

Hopefully someone here can tell us if this is possible, and if so help with the script.

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.
April 18, 2018

We need to be careful here.  Do you genuinely mean a "checklist" field (as provided by an add-on), or is that you describing a standard "checkbox" field?

If it is a check-list, you have to use a validator on it, you can't make it mandatory in field config.  But checkboxes do work, the will force the selection of one or more options.

Mansi Patel April 19, 2018

Hi Nic,

I want to enforce selection of only one option. I tried checkbox and checklist both with validations but its not working as expected.

Thanks,

Mansi

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.
April 19, 2018

For a single option, use a "mandatory" radio button or select list field.

0 votes
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2018

Hello, Mansi.

If you change the field to required in the field configuration option, it should have a red asterisk alongside the field in the screen and the user should not be able to create or save the change in the issue without selecting something on the field.

In your project go to Project Settings > Fields and check if your "Agreement" field is listed there and if it's marked as "Yes" in the required column. Make sure that the field is linked to the screen you're testing.

Also, just to check and so I can replicate here, this field is a "Select List (single choice)" type, right?

Kind regards,
Maurício Karas

Mansi Patel April 19, 2018

Hi Mauricio,

I am using Standard "Checklist" field. I want to make sure that user selects only one option out of 2 and making it required doesn't enforce that validation.

so is it any other way to make it work?

 

Thanks,

Mansi

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events