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()
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.