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

JMWE or some other tool: mandatory fields depending on the choice of single select field

Hello everyone,

 

I have the following problem not only when creating a ticket, but also when editing a ticket in the future after creating it.

Field 1 (single select field) has a minimum of four values, say A, B, C, D, E, and in case A, B or C is selected, Field 2 (Date field) must not be empty and must be filled with a date, and Field 3 (Text Field) must also not be empty. If the value D or E is selected, these two fields may be empty.

 

Is this possible to do?

 

Best regards

1 answer

1 accepted

2 votes
Answer accepted
Alex Koxaras _Relational_
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 @Jurica Petricevic 

I would add a scripted JMWE validator with the following script:

if (issue.getRawValue("customfield_SINGLESELECT_ID")?.value in ["A", "B", "C"])
{
issue.get("customfield_DATEFIELD_ID") != null && issue.get("customfield_TEXIFIELD_ID") != null
}

On the above code replace the ID of the custom fields with your IDs.

Let me know if you managed it!

@Alex Koxaras _Relational_ Hi, 

thx for your time mate.

 

Scripted (Groovy) Validator 

my script isnt working for some reason he doesnt chk the value in the field

if (issue.getRawValue("customfield_16100")?.value in ["R", "G", "P"])
{
issue.get("customfield_13651") != null && issue.get("customfield_13203") != null
}

 I have to choose a For filed Box, what should i pick there or leave it empty?

I am not sure why doesnt work. Can you help me here some more?

 

Best regards

Alex Koxaras _Relational_
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

@Jurica Petricevic I dont understand the "I have to choose a For filed Box". Try to do a validation of your script first:

test.png

And paste an image of what you are getting.

@Alex Koxaras _Relational_ we needed 

else true

now it works.

if (issue.getRawValue("customfield_16100")?.value in ["R","G","P"])
{
issue.get("customfield_13651") != null && issue.get("customfield_13203") != null
}
else true

@Alex Koxaras _Relational_ Thx a lot. Your on my beer list :)

Alex Koxaras _Relational_
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

You got to hold on to that promise @Jurica Petricevic🍺🍺🍺🍺

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events