Bean shell validator Use With Numbers

Confluence User - 09 Feb, 2019

Hi Folks ¡  i need validate that a calculation field  be greater than 1 (one), someone  have an example to do it with bean shell?

thanks

 

beanshell;#beanshell

1


10 Feb, 2019 •
confluenceUser •
•
confluenceUser •

Try this. You need to code in java.

if(Integer.parseInt(values[0]) < 1){
    formData.addFormError("calculatonFieldID", "Must be more than 1."); //change field id to your calculation field
	return false;
}else{
	return true;
}
RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print