Limit number of characters in single/multiline text fields

Hi there, 

How can I limit the number of characters in a single line and multi-line text field? From past posts, I understand this can be done with JavaScript code pasted in the field's description, but it is not working. 

Running JIRA v 7.4. Any help would be greatly appreciated. 




1 answer

0 votes

Hi James,

I found that I could restrict the input with a script such as

<script type="text/javascript"> document.getElementById("customfield_10203").maxLength=8; </script>

Which can limit the editing of a field to only 8 characters.  I was able to do this in my Jira 7.5.0. instance.

However this only appears to work when you click the Edit button for the issue.  If your Jira instance is setup to use the inline edit feature, it looks like changing the value this way does not honor this imposed limitation.


However I don't really like using javascript in this way.  Mostly because this only effects users in the web gui.  With Jira, it is also possible that issues could be created via the REST API, which in turn would not be effected at all by this java script work-around.  Because of that, I was trying to see if there was another way around this that could check for both conditions.

I found an interesting related post in

In that post @Adrian Vital  purposed using a workflow validator in order to check the length of a field using a regex.  This might be helpful in order to make sure that an issue cannot transition until this field is corrected with an appropriate value.  But the workflow validator only prevents transitions, it does not directly effect what value can be entered in that issue at any other given time.

I hope this helps,


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,076 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you