Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner Behaviour om a cascading select list field


I have made a behaviour that, based on the choice in a cascading select list field in an issue-picker field, should only show the issues where the chosen value in the cascading select list field is also filled. (Show in a request type on a JSM portal)

Unfortunately, the behaviour does not work.


I have a copy of this behaviour based on a single select field and it works as expected.


What is wrong in the “cascading select list field” behaviour script?

Can anyone help me?

Regards, Marco


import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def assignmentGroup = getFieldById(getFieldChanged()).value

getFieldByName("Standaard Change").setConfigParam("currentJql", "issuetype = 'Test Case Template' AND status = Active AND summary !~ Rollback AND cf[14207] = \"" + assignmentGroup + "\"")



Screenshot 2021-05-12 at 16.50.46.png

2 answers

2 accepted

0 votes
Answer accepted


I've got it working with the following script in the behaviour


import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.getCustomFieldManager()def cfield = getFieldByName("Assignment Group (Cascading)")Map mapValue = cfield.getValue() as Mapdef value1 = mapValue.get(0).toString() getFieldByName("Standaard Change").setConfigParam("currentJql", "issuetype = 'Test Case Template' AND status = Active AND summary !~ Rollback AND cf[14207] = \"" + value1 + "\"")
0 votes
Answer accepted

Hi @Marco Brundel 

The approach you are taking is not correct.

You should instead use two separate fields. The first will be a List, and the second would be a Text Field which you can convert to a Single or Multi-Select list using the Select List Conversion approach shown in this ScriptRunner Documentation.  In that conversion behaviour, you can include the JQL Query to specify which issues you want to display.

Below is an example working Behaviour code for your reference:-

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours behaviours
def groupList = getFieldById(fieldChanged)
def groupListValue = groupList.value.toString()

def issuesField = getFieldByName("Issues")

ajaxOptions: [
url : "${baseUrl}/rest/scriptrunner-jira/latest/issue/picker",
query: true,

data: [
currentJql : "project = TEST and reporter in membersOf(${groupListValue})",
label : "Pick high priority issue in Support project",
showSubTasks: false,
formatResponse: "issue"
css: "max-width: 500px; width: 500px",

Please note, this sample code is not 100% exact to your environment. Hence, you will need to make the required modifications.

Below is a print screen of the Behaviour configuration:-


What this code does is that it uses the Groups list to filter the JQL query and update the options available in the Issues text field, which is converted to a Single-Select List

Below is a print screen of the Custom Field configurations used:-


If you observe the print screen above, the Group List is a Single Select list, and the Issues field is Text Field by default.


Below are a few print screens of some test for your reference:-


The Group List example displays the groups available, i.e. jira-administrators and jira-software-users


When the jira-administrators is selected from the Group List, the Issues list is filtered and displays the issues reported by the users in the jira-administrators group.


Next, if the group is changed to jira-software-users, the Issues list options are updated to display only issues reported by users from the jira-software-users group.

I hope this helps to answer your question. :)

Thank you and Kind Regards,


Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

Thanks for your comment.

This alone does not help me to get my usecase working. In the JIRA my customer uses a cascade selection field (assignmentGroup) and based on the choice made in this cascade selection field, the selection of issues in the issuepicker must be shown. So, only issues with the same assignmentGroup. 

"issuetype = 'Test Case Template' AND status = Active AND summary !~ Rollback AND cf[14207] = \"" + assignmentGroup + "\""

This JQL is working with a normal select field, and i don't understand why this JQL not is working with a cascade select field.

Regards, Marco

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

611 views 5 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you