How to set Minimum Legth for Description & Maximum length for Summary.

Hi,

Currently we have a requirement of reducing Summary field length to 100 chars from existing 256.

And Description field length should be greater than the summary field length.

 

Can you let me know how to achieve it....

 

Thanks in Advance.

1 answer

0 vote

You're going to need code to limit the summary field, although there are several approaches.

  • Change the "edit template" for the summary field so that it uses html code to limit the user to 100 characters.  Whilst this is relatively easy to do, it does mean changing core code in JIRA, which you then have to maintain during upgrades, and it's not supported by Atlassian.  It won't stop all attempts to use more than 100 characters either - you'll still be able to do it with automation/scripts and REST.  You may have to repeat changes for it in add-ons too, if they expose the summary to users in different ways
  • Write javascript to limit it - this avoids "code change" as above, but is very difficult as you have to avoid clashing with existing js code and inject it in many places, as there are several ways to edit the summary.  Again, it won't protect you from automation/scripts or REST calls.
  • Use the Behaviours functions in the Script Runner add-on to do it (technically, this is similar to the js idea above, but it's a lot easier than writing your own!)
  • Use validators.  These prevent users from progressing issues through the workflow if the data is incorrect.  The downside is that someone could edit a summary to make it too long, but they won't be able to progress with the issue workflows until they correct the summary.  You will need to find/write a validator to do this and install it as an add-on, but it is only a few lines of code (As usual, I'd do it with the Script Runner).  This trick is absolute - it completely blocks progress until the data is corrected.

    On the description part of the question - you could code for it as above, but it would be a nightmare.  I think Behaviours can do it, although I've not tried.  Again, a short validator would be the absolute approach - no progress unless summary.size <= description.size

 

Thanks. I will try these options.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

503 views 1 18
Join discussion

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