Jira Assets - use regular expression for attribute validation - max 3 characters

Simon Sahli
Contributor
June 5, 2024

Hi Atlassian community,

we are using Jira Assets and for one attribute we would like that only 3 characters can be used. This is a rule and if people are not doing this then we get problems in post processes.

I know there is a validation functionality for Jira Asset attributes for which one can use a "regular expression". I however never used this and I am not sure if and how the requirement of max 3 characters can be achieved with this.

Asset Attribute validation.png
My question therefore, do you know if with this regular expression we can define that max 3 characters (signs) shall be used? Or even better precisely 3 characters?
If yes, then I would appreciate an example.

Lastly, this is a text attribute.

Thanks for any kind of input!

Cheers,
Simon

1 answer

1 accepted

0 votes
Answer accepted
Mark Higgins
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

Hi Simon,

I must admint I did use Google Gemini to show me this and it came back with:

 

Specific Format Validation:

^[A-Z]{3}-[0-9]{4}$

This regex matches a specific format, such as three uppercase letters followed by a hyphen and four numbers (e.g., ABC-1234).

 

So in your example, ^[A-Z]{3} will require 3 upper case characters.

I tried this and it appears to work, so I've learnt something as well.

 

Cheers

Mark

Simon Sahli
Contributor
June 17, 2024

Hi @Mark Higgins
thanks for your extra effort and yes it works exactly as I wanted!
You must type in exactly three alphabetical characters with capital letters.
So my case is solved.

I just have one last question before closing this 
What is this "expression language" for Asset attributes called? Like there must be some documentation on this somewhere, non?

Otherwise, I will just also use AI tools for the next case.

Thanks, 
Simon

Mark Higgins
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 17, 2024

Hi Simon,

Its actually an industry standard, called Regex.

If you google Regex, you will see where I found this.

Glad it worked.

Cheers

M

Like Simon Sahli likes this

Suggest an answer

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

Atlassian Community Events