Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
I have a select type multi select custom field named 'Languages' and having values 'English', 'Spanish', 'Chinese', 'Hindi'.
Scenarios1: When user only selects Spanish, Chinese automatically append English through post function.
Like Spanish, Chinese, English.
Scenarios2: When user selects Chinese, Hindi automatically append English through post function.
Like Chinese, Hindi, English.
How to do that?
Thanks
Hi Teju,
Your custom script post function should be something similar to
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue def issue = issue as MutableIssue def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("MultiSelectA") def cfValue = issue.getCustomFieldValue(cf) as ArrayList def optionsManager = ComponentAccessor.getOptionsManager() def optionCCC = optionsManager.getOptions(cf.getRelevantConfig(issue)).find {it.value == "CCC"} def optionAAA = optionsManager.getOptions(cf.getRelevantConfig(issue)).find {it.value == "AAA"} def optionBBB = optionsManager.getOptions(cf.getRelevantConfig(issue)).find {it.value == "BBB"} if (cfValue?.contains(optionAAA) && cfValue?.contains(optionBBB)) { def newValues = [optionCCC] + cfValue issue.setCustomFieldValue(cf, newValues) }
Obviously you can edit the script above to meet your requirements.
Hope that helps,
regards, Thanos
Hi Thanos,
It worked for me..
A thousand thanks to you..
Appreciated your quick reply.
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.