Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Match the issue type with the first option in the cascading dropdown list.

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2023

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".

 

birpt.PNG

1 answer

1 accepted

1 vote
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
July 13, 2023

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:-

behaviour_config.png

Below are a couple of test screenshots for your reference:-

1) For Story issue type

test1.png

1) For Task issue type

test2.png

3) For Bug issue type

test3.png

4) For Epic issue type

test4.png

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 

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2023

Great job, Ram @Ram Kumar Aravindakshan _Adaptavist_! Everything is working perfectly, as expected. I truly appreciate your prompt responses and support. Thank you!

Ram Kumar Aravindakshan _Adaptavist_
Community Champion
July 13, 2023

Hi @Lakshmi CH

Great to hear the solution worked. :-)

Please accept the answer.

Thank you and Kind regards,

Ram

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2023

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?
birpt.PNG

Ram Kumar Aravindakshan _Adaptavist_
Community Champion
July 19, 2023

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

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2023

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

I added ["Create Issue", "Create"]) , then its working

be1.PNG

Suggest an answer

Log in or Sign up to answer