Forums

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

How can I limit the number of characters entered into a text field?

Tina Zakszewski November 6, 2017

We are trying to limit the amount of text that can be entered into the Summary and Description fields so that we do not need to read pages prior to finding out what the request is. This would be at the time of the request creation and possibly during editing through the transitions. Any thoughts?

2 answers

1 accepted

0 votes
Answer accepted
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.
November 6, 2017

Summaries are already short text, so 255 character max. 

Description has no limit, and there's no way to cap it on Cloud yet (on server, you could do an ugly validator that would annoy your users by refusing to create or progress the issue until they'd shortened it, or use a behaviour or javascript, or even hack the html to limit it, etc)

Tina Zakszewski November 6, 2017

Thanks for your response, Nic. 250 characters is WAY too much for our summaries. We are looking for Action items as a TITLE, with the short description to follow in the Description field. Even that, we don't want to read through a novella in order to find out what is needed. I guess this will become a STRONG TRAINING TOPIC. :-)

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.
November 6, 2017

I'm afraid so.  I very rarely see issues that use anything like the 255 characters, they're usually half a dozen words at most, so I wouldn't expect you need to do a lot of training on that one.  Description more so though...

0 votes
Prem
Contributor
May 27, 2024

Hi @Tina Zakszewski 

You can achieve this by following these steps:

1. Go to the workflow and add a validation on the "Create" transition.
2. Add a validation via "Script Runner".
3. Use the following script:

issue.summary.split(' ').length >= 1 && issue.summary.split(' ').length <= 10
(Modify the number of words as per your requirement).

4. Test the script and add it.
5. Define a custom error message to help users understand the error.

Suggest an answer

Log in or Sign up to answer