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

Sivarama Krishna
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 2, 2016

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 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2016

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

 

Sivarama Krishna
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 3, 2016

Thanks. I will try these options.

Suggest an answer

Log in or Sign up to answer