Is there a way to define a customfield as UNIQUE ?

Manuel Campomanes June 26, 2012

In JIRA 5.0, can I set a customfield of type Text (<255 char) as UNIQUE ?

3 answers

1 accepted

Sascha Ziemann January 13, 2020

The plugin does not prevent spaces in the value. If you define a field with the regular expression "^[a-z]+$", you can add the following values: "ABC", " ABC" and "ABC ". The Add-On accepts them all as values, which differ from each other. => FAILURE

1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2012

Not out of the box in JIRA. You will have to develop a new custom field type in a plugin.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 26, 2012

What you're asking for there is to block all custom fields after the addition of one single short-text field. That's really not a good idea, and not supported - the point of custom field types is that you CAN have many of them.

Jira certainly won't support that off-the-shelf, but it may be possible to create a custom field type that only allows one instance of itself.

I wouldn't bother though - if you really need to have one and only one instance of a custom field, then the most flexible, cheap, fast and effective option is "educate your administrators not to add more than one".

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2012

I thought he is asking about making the value unique and not the custom field itself! Development anyways ;)

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 26, 2012

Ahh, unique value, right. I didn't see that in the question, so if it's that, I apologise! (And still agree with your answer - reach for the development kit...)

Suggest an answer

Log in or Sign up to answer