Can I restrict Short text type custom field to only have Yes or No
Asked by Prerana Bhatt Koulmane Sathyanarayana:

Hello Everyone!

I want customer to input Either Yes or No in one of the custom field I have. I don;t want to create a radio/Check box field type. I want the field type to be short text \& somehow want to add a condition or trigger/validator that checks if Customers have typed yes or no.

If it's any other random letters, I want it to default it to NO. is this possible? Thanks in Advance


Answers:
author: Mark Higgins
body: Hi [@Prerana Bhatt Koulmane Sathyanarayana](/t5/user/viewprofilepage/user-id/5444594)

You may have your reasons, but in the User Case you have described, the normal options would be to create the field as a Single Choice Custom Field , with Yes or No options, and default to No.

This is for Custom Fields, and you can not do any Regex at that time.

However (see below) if you use a form, then you can.

![Screenshot 2024-08-27 152439.png](https://community.atlassian.com/t5/image/serverpage/image-id/343997i5D7788D2ECDD7732/image-size/large?v=v2&px=999 "Screenshot 2024-08-27 152439.png")

Then go into the Context and set the Default.

![Screenshot 2024-08-27 152201.png](https://community.atlassian.com/t5/image/serverpage/image-id/343996i219714863EAAEF08/image-size/large?v=v2&px=999 "Screenshot 2024-08-27 152201.png")

If you want to use a Form, then Yes, you could do that, and link you Custom field to the Form Field

![Screenshot 2024-08-27 152912.png](https://community.atlassian.com/t5/image/serverpage/image-id/343998iD6458E0E424AD899/image-size/large?v=v2&px=999 "Screenshot 2024-08-27 152912.png")

This field will ensure that the field is Yes or No, but it will not default to No, if someone enters something else.

Hope there are some options for you there.

Mark

comments: author: Prerana Bhatt Koulmane Sathyanarayana
body: Thank you Mark. Appreciate your insight.

I will see if our team is okay with this. We were looking in JIRA for something similar to a Boolean function with Yes or No option. My guess is that this probably the closest option


author: Mark Higgins
body: Hi [@Prerana Bhatt Koulmane Sathyanarayana](/t5/user/viewprofilepage/user-id/5444594)

Jira doesn't have a boolean data type, and I looked at the last update on the request was 2016 :-)

Assets does allow a Boolean,

![Screenshot 2024-08-28 074051.png](https://community.atlassian.com/t5/image/serverpage/image-id/344125i3180412C298D374F/image-size/large?v=v2&px=999 "Screenshot 2024-08-28 074051.png")

which allows True or False, but not Yes or No.

![Screenshot 2024-08-28 074210.png](https://community.atlassian.com/t5/image/serverpage/image-id/344126i151947DFA119386C/image-size/large?v=v2&px=999 "Screenshot 2024-08-28 074210.png")

Good luck

Mark


author: Fabian Lim
body: Hi [@Prerana Bhatt Koulmane Sathyanarayana](/t5/user/viewprofilepage/user-id/5444594)

Are they entering "YES" or "NO" from the portal screen when they are creating the ticket? If so, you can have a validator check with reg expression at creation: <https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-validators-for-company-managed-projects/> (You will have to figure out what the exact reg would be though).


Tags: cloud

jira-service-management

jira-service-management-cloud