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,507
Community Members
 
Community Events
184
Community Groups

add a custom fields validator using jira expression

Hello,
I'm working on a projet where I have a screen with custom fields on it, I would like to use a validator using jira expression.

I read the documentation but I didn't understand how to use it on a custom field.

3 answers

1 accepted

2 votes
Answer accepted
Oliver Siebenmarck _Polymetis Apps_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 06, 2021

Hi @Koceila CHERGUI ,

Welcome to the community! 

You will need two things to use Jira Expressions in a Validator in Jira Cloud. First (like @Fabian Lim correctly mentioned) , you need a workflow app that supports Jira Expressions. In my biased opinion Cloud Workflows is the easiest option, although there are also other options in the marketplace. 

Second, you need to know the ID of your custom field. And that's it. You can now use an expression like this:

issue.customfield_10019 != "foo"

To ensure that your custom field is not set to "foo". 

Of course, Jira Expressions are pretty powerful but can seem a bit daunting at the start. If you just want to play around with them before committing any buying an app, there's a free app called Expression Tester to let you do just that.

Hope that helps,
 Oliver

Full disclosure: I work for the vendor who created Cloud Workflows and the Expression Tester. I'm also quite a big fan of Jira Expressions. Let me know if you need any help getting started.

I would like to thank you for your reply.
I understand more about it.

 

Koceila.

Hey guys, 

I am in a similar situation. My use case is I want to validate on a custom field where if the custom field has an option selected from the dropdown say "x" then I want the user to fill out a different field on the "close issue screen" 

I used the Jira expression JWT to say "issue?.customfield_10152?.value == "x" then on close show an error saying "Please fill out xyz field before closing" . But this somehow doesn't seem to work. Any ideas? 

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 24, 2023

Hi @Nikita Rao ,

in this case, you probably need a conditional operator (see https://apps.decadis.net/pages/viewpage.action?pageId=38569652#expand-Examplesofusingtheconditionaloperator) like

issue?.customfield_10152?.value == "x" ? issue?.customfield_##### != null : true

replacing ###### with the custom field ID of your xyz field.

With this expression, the xyz field must not be empty if your 10152 field equals "x". Otherwißse the condition is true by default.

Please let me know if that solves your request.

Cheers,
Thorsten

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 06, 2021

Hi @Koceila CHERGUI,

Take a look at this tutorial on transition screens which describes how you can add validators end to end. Link: https://www.youtube.com/watch?v=RIKYX-z4meM

You may have to purchase a certain plugin such as JSU to have the expression validator: https://beecom-products.atlassian.net/wiki/spaces/JSU/pages/25680565/Regular+Expression+Check+Validator

I hope this helps 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events