Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,098
Community Members
 
Community Events
168
Community Groups

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

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

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.

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 Jan 06, 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

Atlassian Community Events