Hi Team,
Can anyone please suggest me on this ?
When creating the ticket, I utilized the script runner behavior to align the issue type with the first option in the cascading dropdown list. During the process, I selected both options from the dropdowns in the cascading list (I have attached a screenshot for your reference)
Whenever I try to edit the ticket, the second drop-down menu keeps switching back to "None" instead of staying on the selected option (I have attached a screenshot for your reference).
Here is the behavior I used Intitilasier.
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def issueType = issueContext.issueType.name
def cascadingField = getFieldByName('Cascading Field')
if (issueType in ['Issue Type 1', 'Issue Type 2', 'Issue Type 3']) {
cascadingField.setFormValue([issueType])
}
Hi @Lakshmi CH
You could make sure that the code only fires on the create step.
if (getActionName() = "Create" && issueType in ['Issue Type 1', 'Issue Type 2', 'Issue Type 3'])
Something like that. I haven't tested it, but the logic seems sound.
Thank you so much@Tim Perrault , It is working now, but small correction. Not
getActionName() = "Create" , it is (getActionName() in ["Create Issue", "Create"])
if ((getActionName() in ["Create Issue", "Create"]) && issueType in ['Issue Type 1', 'Issue Type 2', 'Issue Type 3'])
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.