Forums

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

Display max result using Select List Conversions?

Fredrik Ivansson Flinta
Contributor
October 24, 2019

Hi,

 

Using the out of the box example from Dynamically Changing the Picker Query, I would like to get all results from the jql listed in the select list, not just the first 10 (which seems to be the default).

I have tried to add:

max : 30, 

 to the ajaxOptions but It still results in only the first 10.

 

Using the code from the page above page:

def selectedProject = getFieldById(getFieldChanged()).value as Project
def jqlSearchField = getFieldByName("TextFieldA")

if (selectedProject) {
    jqlSearchField.setReadOnly(false).setDescription("Select an issue in the ${selectedProject.name} project")

    jqlSearchField.convertToSingleSelect([
        ajaxOptions: [
            url           : getBaseUrl() + "/rest/scriptrunner-jira/latest/issue/picker",
            query         : true,

            data          : [
                currentJql  : "project = ${selectedProject.key} ORDER BY key ASC", 
                label       : "Pick high priority issue in ${selectedProject.name} project",
                max         : 30,
], formatResponse: "issue" ], css : "max-width: 500px; width: 500px", ]) } else { // selected project was null - disable control jqlSearchField.convertToShortText() jqlSearchField.setReadOnly(true).setDescription("Please select a project before entering the issue") }

 Anyone can help out? :)

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Katy Kelly
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.
October 24, 2019

Hi, 

There is an existing bug report for this here: https://productsupport.adaptavist.com/browse/SRJIRA-3617

Regards,

Katy

Fredrik Ivansson Flinta
Contributor
October 24, 2019

Thanks Katy :)

Fredrik Ivansson Flinta
Contributor
October 30, 2019

Report back since 5.6.6.1-jira8 of Scriptrunner is now out.

Using max on the ajaxOptions now works as expected.

TAGS
AUG Leaders

Atlassian Community Events