Hello Community,
We have multi select drop down custom field which has more than 10 values inside it.
When user selects more than 6 values then it should throw the error instantly saying that "you cant select more than 6 values"
We can achieve this using JMEW validators. but validators works only when we do the transition.
But, We want to display the error message As soon as user selects more than 6 options.
We don't want to wait until user do the transition then showing the error message.
Hi @PLaksh11
If you have ScriptRunner, you can achieve this by using Behaviours in ScriptRunner.
If you have that:
Go To: ScriptRunner --> Behaviours
Create a new behavior and map it to your project + issuetype
Add the following script.
def field = getFieldByName("Your Multi-Select Field")
def selectedValues = field.getValue() as List
if (selectedValues?.size() > 6) {
field.setError("You can't select more than 6 values.")
} else {
field.clearError()
}
Let me know if you succeed.
Hi @Gor Greyan
Thanks for the Reply.
The code is not working in Jira cloud. Also i found that real time field validation is not possible. we can get error only doing transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @PLaksh11
Thanks for the answer.
Yes, you are right, I have also reviewed and found out, that it is possible only in transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @PLaksh11
We don't have a way to instantly show the error message when a field is updated as we don't have a field level validation with the native Jira functionalities. You may explore the possibility of an automation rule to revert the field to its previous value if more than 5 selections are made.
A similar discussion here: https://community.atlassian.com/forums/Jira-questions/Automation-to-count-specific-selections-in-multi-select-field/qaq-p/2702711
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.