Restrict version picker to select single value for affect version field

Nikita Maniyar January 2, 2018

1. As a user, for affect/s version field I should be able to add only single value (choice) for this field.

Currently it is allowing more than one options.

2. As a user I should not be able to create version. How to restrict it?

2 answers

1 vote
John Chin
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.
November 25, 2019

Hi,

Please use this script in the field server-side script:

def field = getFieldById(getFieldChanged())

def version = field.getValue() as Collection

if (version.size() > 1)
{
    field.setValid(false)
    field.setError("Version/s can only be one value.")
}
else

{
    field.setValid(true)
    field.clearError()
}

Thanks

Br,

John Chin

sandeep4774 November 25, 2019

Hi @John Chin , That worked. Thanks for helping.

1 vote
Alexey Matveev
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.
January 2, 2018

Hello,

If you have Scriptrunner, you could do it with the behaviour functionality (available only for Jira Server/Data Center) or custom validators.

sandeep4774 November 15, 2019

Hi @Alexey Matveev , I have the same requirement as mentioned above and we are using Scriptrunner (behaviour) app. Could you please provide more details to configure this behaviour?

Suggest an answer

Log in or Sign up to answer