Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,745
Community Members
 
Community Events
184
Community Groups

Field validation to allow integers only without mandatory field

Edited

Hi Team,

We would like to validate the numeric value like 50000 or 201203, etc on the single-line text field. I tried to use a "Simple scripted validator" in workflow validator and applied the below condition. It's working, but we do not want this field as mandatory. It's validating the field, but it's not allowing to create of the ticket without entering the value. Is there any option to make this field validation without mandatory?

cfValues['Cost at Approval'] ==~ /^[0-9]*$/

 

2 answers

1 accepted

1 vote
Answer accepted
David Fischer _Appfire_
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 12, 2023

Hi @Lakshmi S ,

Using JMWE's Scripted Validator, you can use this script:

!issue.get("Cost at Approval") || issue.get("Cost at Approval") ==~ /^\d+$/

Thank you @David Fischer _Appfire_ Its working as expected.

0 votes
Karim ABO HASHISH
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 12, 2023

hi @Lakshmi S 

could you please try with this expression 

/^[0-9]{0-n}$/

it allows for empty value.

it should normally work on Cloud version but I didn't test it on the server version.

Let me know how it went for you.

Cheers,

Karim

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events