Field validator on checkbox custom field

Lina Abu-Baker September 7, 2021

Hi all,

 

I have a custom field that has yes or no checkboxes. This field by default is checked no but when transitioning from one status to another, we would like to put in a validation that if the box is checked yes, that a certain field should be filled out. Does anyone know if this is possible to do or how to do this?

 

Thanks!

Lina

1 answer

1 accepted

0 votes
Answer accepted
Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2021

@Lina Abu-BakerI believe you can accomplish this using two validators.

  • Field has been modified Validator
  • Field has single value Validator

The first you will set that the "Checkbox field" must be modified, and the second validator will garantee that the field has only one option checked.

If the default value is "No", then will need unselect the value "No" and check the value "Yes".

If you allow me, you could use two post functions if you need to change the option.
The first would be to clear the field and the other to set the value in the field to "Yes"

 

Condi.pngValidator.png

I hope I helped you.

If this post was helpful, mark it as Accepted solutions, so you can help others who may have the same difficulties.

If your question has not been resolved, please post again with more details.

Lina Abu-Baker September 8, 2021

Hi @Carlos Faddul ,

 

Thank you for your answer. I am not sure if I can use these options because I need it to check if the checkbox has been changed to yes before the transition happens. 

 

Thanks,

Lina

Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2021

@Lina Abu-Baker

Why you do not use a post function to set the value of field ?

Lina Abu-Baker September 8, 2021

@Carlos Faddul If I use a post function, would I need to create a custom script?

Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2021

@Lina Abu-Baker  no need for custom script :)

The configuration of post function it's very easy.

But you need to set correctly the post functions

First the mark yellow → you will clear any values in the custom field check box (because this is a multiple options field)

Second the mark green → you will set the value to "Yes" (or anything other value that you want)

Captura de tela 2021-09-08 182100.png

I just recorded this video to help you with the post functions (need to order correctly they)

https://youtu.be/8qXQmuzEt-Q

You only need to order correctly the post functions in order, to they executed to do what you want.

I hope I helped you.

If this post was helpful, mark it as Accepted solutions, so you can help others who may have the same difficulties.

If your question has not been resolved, please post again with more details.

Lina Abu-Baker September 8, 2021

@Carlos Faddul thank you so much for the step by step video! It's very helpful. 

 

The thing is the ticket does not always need to be checked yes. The user will determine whether or not the custom field should be checked yes or remain no. They would check yes and then click on "request approval." When they click on "request approval" is when I would need some sort of validation that the field changed from no to yes and if it did change, have the user go back and fill out a field called (if they did not already) "required URL." 

 

Does this make more sense?

 

Thanks,

Lina

Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2021

@Lina Abu-Bakerto do this kind of validation, you will need a add-on, like JMWE or JWT to create Validators with conditions (this is possible to do with JMWE)

With the JMWE and a validator field, you will need to mark to run the validator if checked the condition (then you put your condition) (but unfortanally i cant show how to use this function of JMWE because i don't have in my personal instance or company instance) (i worked with jmwe at the past)

Lina Abu-Baker September 8, 2021

@Carlos Faddul thanks for the recommendation, I will look into this. Do you think I could do it with scriptrunner? Or with automation conditions?

Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2021

@Lina Abu-Baker with the scriptrunner you maybe can do this (i do not remember very well, because i am working with jira without app  just under a year).

With the automation you can edit issues :)

Suggest an answer

Log in or Sign up to answer