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.