Dear all,
i have created a custom fields (free text type) called Contract Number, i want to validate when create an issue, user must input the contract number fields with a numerical value and longs 12 characters, how to make it possible? is it from the workflow or any other choice? i have JMWE as and addon or should i change another custom fields type?
Thankyou
Hi,
I’m Prosper, a support engineer at Appfire, and I’m here to help you.
Based on your question, yes you can add a validator via the workflow to validate the input field when the issue is created.
You can use the Field Required Validator to conditionally validate issue fields by editing the workflow and creating a validator.
I attached an example image showing a sample validator to fit your use case. You can use the Issue Fields dropdown to get the id of the custom field and then add you desired condition.
You can check out this documentation for more information or please contact our support if you have any other questions about this query.
We’ll be happy to help you!
Best regards,
Prosper.
Thankyou for the support, it really helps, one more question, can we validate the value must be numerical?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have tried the suggestion that you shared above, but it seems not working, i think because the conditional validation is for condition that must be true to make the validator work, is there any possible ways to make it happen?
Thankyou
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nicolas Andika
Apologies for the late response, and you are correct, the conditional validation must be true for the validation to work.
The approach to take would be to "Build-your-own Validator". I tested with this function:
issue.customfield_10166 != null && issue.customfield_10166.length == 12 && issue.customfield_10166.split('').every(char => char >= '0' && char <= '9')
and it worked as expected. It is also worth mentioning i tested this with the short text (plain text only) custom field as it doesn't seem to work with rich text.
Please try this out and let me know if it resolved your issue.
Regards,
Prosper.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Nicolas Andika ,
I think you should be able to validate this with JMWE
You need to decide if you want to have the validation running whenever anyone is editing the field or via a transition step in the worklow.
I have seen this blog describe what I think you're after.
best of luck
/Lisa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.