Hello,
I was trying to make a custom field (not Atlassian built-in field, ie. Checklist or Database Custom Field field) required via Groovy by using Behaviours plug-in from Jamie Echlin.
This piece of Groovy code throws a Javascript error and the field remains optional; also Javascript stops running.
formField = getFieldById("customfield_xxxx") formField.setRequired(true) <---- JS error arises.
If I try this on regular fields like String, Select, etc. everything works fine.
My question is: which field types are supported for setRequired function?
I've noticed that the setHidden() function works even with non Atlassian built-in fields... is there any special requirement to make setRequired() compatible with non Atlassian built-in fields? Or is it a bug?
Community moderators have prevented the ability to post new answers.
It's just luck of the draw whether it works or not, it depends how closely the generated HTML matches that of the standard custom fields.
If there was a javascript API for setting field values, making things required etc, it would be a lot simpler.
So plugin custom fields can be done on a bespoke basis, based on demand, or $$$.
I think there is already an issue for DBCF fields in https://jamieechlin.atlassian.net/browse/JBHV.
Thank you Jamie,
that's really a pity. We are using JIRA even for activities that are not code related, becase JIRA is so flexible that we are trying to use it any way we can to solve general company management problems.
We had the same issue with JIRA Service Desk that, as Behaviours, cannot use Custom Fields at all on the Portals. I've browsed the JBVH project and I've not found the DBCF issue you mentioned. Actually we need support for the following fields, and if the case, we'll open an issue for each of them:
We are extending the interface even with other fields but for now these are the most important ones for us.
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.