You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
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()
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.