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

Simple Script Validator for Component values

Hi all,

 

We have 2 kinds of Components: IT and Business.

Business Components are: PI Planning, Business Go-Live.

IT is the rest.

Can you help with writing a simple script validator, which validates that the Component field shouldn't have only Business Components, but at least one IT Component?

 

Thank you,

Duong

 

1 answer

Please find the behaviour script here - credits to Original Poster https://community.atlassian.com/t5/Jira-questions/Need-to-restrict-Component-s-to-single-select-using-ScriptRunner/qaq-p/680112?anon_like=1751359

It works with JSW 8.20.

def ComponentsField = getFieldById("components")
def components = ComponentsField.getValue() as Collection
if (components.size() > 1) {
ComponentsField.setValid(false)
ComponentsField.setError("Component can only be one value.")
}
else {
ComponentsField.setValid(true)
ComponentsField.clearError()
}

Suggest an answer

Log in or Sign up to answer