Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can we add validation for Number custom field to accept only positive integers in jira

gadamchetty ramya May 23, 2018

It is possible to script filed in JIRA using script runner ?

2 answers

1 accepted

0 votes
Answer accepted
Grigory Salnikov
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.
May 23, 2018

Hi!

Never used a script runner but have similar tasks. This free add-on helps me a lot:

Unique Regex Custom Field

You can restrict entered values to whatever you want.

gadamchetty ramya May 23, 2018

Thank you so much 

Grigory Salnikov
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.
May 23, 2018

You're welcome :)

1 vote
Nic Brough -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.
May 23, 2018

Yes, you can write a Behaviour that would block people entering anything smaller than 0, or write a validator that can say "if issue.getCustomFieldByName("My number") < 0 return false".  Obviously, you'll want to make that a bit more pretty with feedback and so on.

gadamchetty ramya May 23, 2018

Thanks for your help.
can we add a validation for existing custom field ? Instead of creating new field through script filed .

Nic Brough -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.
May 23, 2018

You don't need to validate scripted fields, because they have no way for users to enter data into them.  They contain calculated values for display only.

For a standard custom field, yes, you can do it with Behaviours or a validator script.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events