Forums

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

Require minimum length in field with JSU

Philipp Tauber July 11, 2018

I'm trying to restrict the length of the description field. I'v already found the following solution but I'm not able to tweak it to my needs.

https://confluence.atlassian.com/jirakb/using-workflow-regular-expression-check-validator-to-restrict-text-field-in-number-format-859509784.html

My understanding is that I would have to change the expression like that:

^[0-9]{160-255}$

The descritionfield should have a length of 160-255 and you should be able to enter anything, lower case / upper case / numbers / ....

But i will always get an error:

We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file.

Which is not the error message I wrote which confuses me further.

2 answers

1 accepted

2 votes
Answer accepted
Mirek
Community Champion
July 11, 2018

I think something is wrong with this regular expression that you are trying to use...

^[0-9]{160-255}$

Overall it would allow only numbers.

Please try to use this one instead:

^.{160,255}$
Philipp Tauber July 11, 2018

Thank you that worked like a charm.

Mirek
Community Champion
July 11, 2018

Glad to hear that :)

Yousra Abuabdullah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2021

This is working great if we have only one paragraph, but once we press "Enter" and add another paragraph it won't work and the error appears.

How to fix this issue and allow adding new lines while checking the expression?

Like Jasmin Winger likes this
0 votes
Mirek
Community Champion
July 11, 2018

Hmm.. The error seems similar to this problem - https://confluence.atlassian.com/jirakb/can-t-create-issues-due-to-script-runner-for-jira-being-disabled-899429413.html . Are you using Script Runner for JIRA plugin? If not could you share screenshots from your workflow configuration (validators and post functions) on the transition that you would like to validate?

Philipp Tauber July 11, 2018

Thank you for your reply.

I have checked the suggested solution from your ticket, since we run scriptrunner, but unfortunately that didn't help.

We are currently running the trial version of scriptrunner, but there should be no restrictions?

Mirek
Community Champion
July 11, 2018

Could you then share screenshots from your workflow configuration (validators and post functions) on the transition that you would like to validate and create screen? Any errors in the JIRA logs?

Philipp Tauber July 11, 2018

Jira1.PNGJira0.PNG

Suggest an answer

Log in or Sign up to answer