How to update JQL query for the ScriptRunner custom field "Issue Picker"?

Александр Клюков February 10, 2019

Adaptavist instructions at

https://scriptrunner.adaptavist.com/latest/jira/script-fields/issue-picker.html

said that I can modify JQL query for custom field "Issue Picker" in Behaviours, by setting "field.setConfigParam('currentJql', '<your jql query>')".

I have tried to set field parameters in Behaviour, but the list of suggested issues in this field (it is called "Purchase order") does not change.

I used the code below in Behaviour:


getFieldByName("Purchase order").setConfigParam('currentJql', 'type=Task');

 

And when I open the screen with this custom field, it is suggested to choose issues by the query, that was defined when I create this field ('type=Bug'). But if I will choose the suggested issue, and will try to submit the form - I will receive an error, that I choose the wrong issue (not 'Type=Task').


So I just wonder - how I can change the JQL for custom field "Issue Picker" in behavior? (I need to do it in behavior, because I need to suggest different issue types based on issue custom field)

 

Any help would be appreciated!

 

1 answer

0 votes
Robin Sadlo February 21, 2019

Hi,

I am stuck at the same point right now.

I found out that when you start typing, the new jql query is applied. The new / filtered suggestion list is what you want. But if you clear the typed filter, you get the original list with the old jql again.

And if you select an issue, which does not match the query a validation error will occur.


So the only thing missing for this to work is, that the initial list of suggestions, with empty filter, is not updated with issues matching the new filter.

Maybe there is a way to trigger such a reload or modify the list by myself.

Александр Клюков February 21, 2019

I found out that this is a bug, and at this moment all that we can do is just wait for a fix - https://productsupport.adaptavist.com/browse/SRJIRA-3119

Like Dave Liao likes this
Dave Liao
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2021

@Александр Клюков @Robin Sadlo looks like this is now fixed as of ScriptRunner 5.5.3 (released in April 2019)!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events