In Behaviour on Jira cloud, I'd like to hide a specific field based on a value selected on other multi-select field.
For example - if one of the selected values (in the multi-select field) is "XYZ" then hide the relevant field.
What is the method to access and check the selected values?
This is my code which I know that works when it is using a single select field:
const myTeamsField = getFieldById("customfield_10022")
const severityField = getFieldById("customfield_10069")
// Check if it's the create view
if (isCreateView()) {
const myTeamsValue = myTeamsField.getValue()
if (myTeamsValue?.value == "Backend") {
severityField.setVisible(true)
} else if (myTeamsValue?.value == "backend") {
severityField.setVisible(false)
}
}
What should be changed? How?
TNX.
Hi Yaniv,
A Multi Select Field returns an array so you would need to check the changed field value as mentioned here.
You would then need to check if the value contained the option you need and if so perform the operation required.
I have created an example script here which shows how when a specific value is selected inside a Multi-Select List Field a Select List Field is made required.
You will be able to use this example as a guide to help create the script that you require.
I hope this helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.