You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I am trying to use Behaviors in conjunction with Project/Issue Type context--all the options are in one context with a project/issue type mapping. The goal is to turn off checkboxes in a multi-select field based on project mapping and issue type, but nothing we do seems to work on the Create screen. Once you click on a checkbox however the behavior works as expected, but, NOT when the page loads initially.
I have seen several examples of the code with slight syntactical variations posted across Jira newsgroups. I've tried them but they all produce the same result. Nothing will change the length of the multi-select field on the Create screen based on Issue Type.
But to reiterate, it does work on the Edit and View screens. Just not on the Create screen, unless that is you select one of the checkboxes. Then it works. Any help would be greatly appreciated. We are using Jira 7.10.x. I've tried setting the Field in the Behavior to both Fieldname and IssueType, but neither of those options worked either.
Here's the server-side script snippet.
import com.atlassian.jira.component.ComponentAccessor
def cFManager = ComponentAccessor.getCustomFieldManager()
def oManager = ComponentAccessor.optionsManager
def envType = customFieldManager.getCustomFieldObject(getFieldChanged())
def config = envType.getRelevantConfig(getIssueContext())
def options = oManager.getOptions(config)
def selectcf = getFieldByName("FieldName")
if (getIssueContext().getIssueType().getName() == "Issue Type 1") {
def optionsMap = options.findAll {
it.value in ["VALUE1","VALUE2",] // list of options to show
}.collectEntries {
[
(it.optionId.toString()): it.value
]
}
selectcf.setFieldOptions(optionsMap)
}
else if (getIssueContext().getIssueType().getName() == "Issue Type 2")
{
def optionsMap = options.findAll {
it.value in ["VALUE3", "VALUE4"] // list of options to show.
}.collectEntries {
[
(it.optionId.toString()): it.value
]
}
selectcf.setFieldOptions(optionsMap)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.