Hi Team,
I have a requirement to match the issue type with the first option in the cascading dropdown list when creating a new ticket.
For example,
1. If the issue type selected is "Customer Incident" the first drop-down option in the Workflow Type should automatically display "Customer Incident".
2. If the issue type selected is "Customer Technical Request" the first drop-down option in the Workflow Type should automatically display "Customer Technical Request".
Hi @Lakshmi CH
For your requirement, you must use ScriptRunner's Behaviour Initialiser.
Below is a sample working code for your reference:-
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def issueType = issueContext.issueType.name
//Rename the field accordingly
def cascadingField = getFieldByName('Sample Cascade')
//Rename the issue types accordingly
if (issueType in ['Story', 'Task', 'Bug', 'Epic']) {
cascadingField.setFormValue([issueType])
}
Please note that the sample working code above is not 100% exact to your environment. Hence, you will need to make the required modifications.
Below is a screenshot of the Behaviour configuration:-
Below are a couple of test screenshots for your reference:-
1) For Story issue type
1) For Task issue type
3) For Bug issue type
4) For Epic issue type
If you observe all 4 screenshots above, you will notice that the parent option in the cascading field changes when the issue type changes.
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
Great job, Ram @Ram Kumar Aravindakshan _Adaptavist_! Everything is working perfectly, as expected. I truly appreciate your prompt responses and support. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lakshmi CH
Great to hear the solution worked. :-)
Please accept the answer.
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.
Hi @Ram Kumar Aravindakshan _Adaptavist_ ,
I came across an issue while trying to edit a ticket. The second drop-down option in the cascading field row appears as "None."
For ex: Whenever I try to edit the ticket, the second drop-down menu keeps switching back to "None" instead of staying on the selected option.
Could you please suggest this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lakshmi CH
Could you please share your updated code along with a screenshot of your Behaviour configuration so I can get a better understanding of the issue?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.