Hello there,
We have a global team and I would like to get a better sense of the statutory holidays in each of our teams' countries via confluence calendar.
Anything out there that would allow me to select and import a particular counties holiday calendar for 2021 ?
Thanks,
Hi @Joel Batac
For your requirement, you should try something like this:-
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def sampleMultiSelect = getFieldById(fieldChanged)
def sampleMultiSelectValue = sampleMultiSelect.value.toString()
def sampleNumber1 = getFieldByName('Sample Number 1')
def sampleNumber2 = getFieldByName('Sample Number 2')
def sampleNumber3 = getFieldByName('Sample Number 3')
sampleNumber1.hidden = true
sampleNumber2.hidden = true
sampleNumber3.hidden = true
if (sampleMultiSelectValue == '[Behaviour, Listener, Fragment]') {
sampleNumber1.hidden = false
sampleNumber2.hidden = false
sampleNumber3.hidden = false
} else if (sampleMultiSelectValue == '[Behaviour, Listener]') {
sampleNumber1.hidden = false
sampleNumber2.hidden = false
} else if (sampleMultiSelectValue == '[Behaviour, Fragment]') {
sampleNumber1.hidden = false
sampleNumber3.hidden = false
} else if (sampleMultiSelectValue == '[Listener, Fragment]') {
sampleNumber2.hidden = false
sampleNumber3.hidden = false
} else if (sampleMultiSelectValue == '[Behaviour]') {
sampleNumber1.hidden = false
} else if (sampleMultiSelectValue == '[Listener]') {
sampleNumber2.hidden = false
} else if (sampleMultiSelectValue == '[Fragment]') {
sampleNumber3.hidden = false
}
Please note that the sample code provided above is not 100% exact to your environment. Hence, you will need to make the required modifications.
Below are a few screenshots for your reference:-
1) When only the Behaviour option is selected from the Multi-Select List, only the Sample Number 1 field is displayed.
2) When only the Listener option is selected from the Multi-Select List, only the Sample Number 2 field is displayed.
3) When only the Fragment option is selected from the Multi-Select List, only the Sample Number 3 field is displayed.
4) When both the Behaviour and Listener options are selected from the Multi-Select List, both the Sample Number 1 and Sample Number 2 fields are displayed.
5) When both the Behaviour and Fragment options are selected from the Multi-Select List, both the Sample Number 1 and Sample Number 3 fields are displayed.
6) When both the Listener and Fragment options are selected from the Multi-Select List, both the Sample Number 2 and Sample Number 3 fields are displayed.
7) When all options are selected from the Multi-Select List, all the Number fields are displayed.
I hope this helps to answer your question. :)
Thank you and Kind regards,
Ram
Thanks Ram. Is it possible to do a loop? In reality the multi select field contains 27 options ( i just gave a 3 for simplicity)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Joel Batac
There is no simple way for this.
Making a loop will not work as expected and will cause errors.
Thank you and Kind regards,
Ram
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.