Set minimum length in description field using Power Scripts

Sistema Datapilar June 5, 2024

Hi,

We already tried using regex without the add-ons, but we can't customize the error message. Therefore, we stumble upon a post that suggests using the Power Script add-on, but we can't seem to find a way to do it. We want to create a validator that sets the minimum length in description field at least 50 character.

2 answers

1 vote
Anna Hryhoruk _Appfire_
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.
June 6, 2024

Hello @Sistema Datapilar 

Yes, you can do that with Power Scripts. 

You just need to add Power Scripts Validator on "Create Issue" transition, please visit this page for step-by-step instruction Conditions and Validators ; as a validator script you need to use the following Jira Expression : 

issue.description.plainText.length > 50

Additional note: for the description field, you need to use "plainText.length" not just "length" because the Description has the type RichText field. 

Hope it helps!
Anna

 

0 votes
Maciej Dudziak _Forgappify_
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.
June 6, 2024

Hi @Sistema Datapilar

If you work in a company-managed project, the described case can be addressed using any Jira expression-based validator available on the Atlassian marketplace.

I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira free app.

The expression you need is as shown on the screen below:

community_06.06_description.png

I am leaving a link to the app's documentation if you are interested.

Cheers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events