Forums

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

Problems with defining values ​​using Database picker type fields.

Layssa Souza
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.
November 4, 2022

Hello guys,

 

I'm having problems with defining values ​​using Database picker type fields.

I created a connection with the database and performed the definition of the list as well as its visualization for each user, however, every time my user needs to edit the field it returns the following error: "Error searching: groovy.lang.MissingMethodException: No signature of method: Script1159$_run_closure1.call() is applicable for argument types: (String, com.atlassian.jira.issue.IssueImpl, ArrayList) values: [, TREINO-2308, [4097]] Possible solutions: any(), any(), find(), grep(), collect(), dump()"

Has anyone had an error similar to this one and can help me?

Attached, I leave the scripts that are behind the field and the behavior that is occurring inside the issues.

 

Evidence 1.pngEvidence 2.pngEvidence 3.png

Evidence 4.pngEvidence 5.pngValue issue.pngEdit issue.png

 

Error: 

Error searching: groovy.lang.MissingMethodException: No signature of method: Script1163$_run_closure1.call() is applicable for argument types: (String, com.atlassian.jira.issue.IssueImpl, ArrayList) values: [, TREINO-2308, [4097]] Possible solutions: any(), any(), find(), grep(), collect(), dump()

groovy.lang.MissingMethodException: No signature of method: Script1163$_run_closure1.call() is applicable for argument types: (String, com.atlassian.jira.issue.IssueImpl, ArrayList) values: [, TREINO-2308, [4097]]
Possible solutions: any(), any(), find(), grep(), collect(), dump()
at com.onresolve.scriptrunner.canned.jira.fields.editable.picker.AbstractGenericPicker.executeOverridable(AbstractGenericPicker.groovy:241)
at com.onresolve.scriptrunner.canned.jira.fields.editable.picker.AbstractGenericPicker.executeOverridable(AbstractGenericPicker.groovy)
at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePickerImpl.getSearchSql(DatabasePickerImpl.groovy:280)
at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePickerImpl$_getSearchResponse_closure1.doCall(DatabasePickerImpl.groovy:114)
at com.onresolve.scriptrunner.db.AbstractDbConnectionManager.withSql(AbstractDbConnectionManager.groovy:69)
at com.onresolve.scriptrunner.db.AbstractDbConnectionManager$withSql.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.db.AbstractDbConnectionManager$withSql.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.db.AbstractDbConnectionManager.withSql(AbstractDbConnectionManager.groovy:85)
at com.onresolve.scriptrunner.db.DbConnectionManager$withSql.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePickerImpl.getSearchResponse(DatabasePickerImpl.groovy:112)
at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePickerImpl$getSearchResponse$1.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.fields.editable.picker.AbstractGenericPicker.getSearchResponse(AbstractGenericPicker.groovy:147)

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
November 7, 2022

Hi @Layssa Souza

Going through the error log you shared, the error may be coming from the Configuration Script.

Could you please try to comment out or remove the configuration script and see if the error persists?

Thank you and Kind regards,

Ram

Layssa Souza
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.
November 7, 2022

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

 

In fact, when I remove this configuration script the field returns.

I created this script because the list that comes from the Database is very large and we need to be able to search within this field, this was the way I managed to correct the search, but the editing stopped working. Is it possible to search this field without breaking the edit?

Evidence 4.pngEvidence 3.pngEvidence 2.pngEvidence 1.png

Ram Kumar Aravindakshan _Adaptavist_
Community Champion
November 11, 2022

Hi @Layssa Souza

Could you try to make a small change to the Search SQL Query and include an Offset, e.g.

select jira_func_id, jira_menu 
from jira_functionalidades
where lower(jira_projecto) ilike lower(?) || '%as3%'
LIMIT 5 OFFSET 6;

If it is for MySQL, something like:-

select jira_func_id, jira_menu 
from jira_functionalidades
where lower(jira_projecto) ilike lower(?) || '%as3%'
LIMIT 5;

and see if it can limit the number of results.

I hope this helps to answer your question. :-)

Thank you and Kind regards,

Ram

Sallo Szrajbman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2023

@Ram Kumar Aravindakshan _Adaptavist_ I think the real solution was not covered.

I'm having the same issue and in my case I cannot avoid using the customized getSearchSql since I need to fetch values from another custom field to use in the query.

Is this mapped as a bug to be fixed already?

Apparently what is happening is that when editing Issues, the Database Picker is sending to the getSearchSql method, the third parameter (original value) as a List, not a String as it was supposed to it.

 

As seen in the logs:

com.onresolve.scriptrunner.runner.rest.jira.error.GenericPickerException: groovy.lang.MissingMethodException: No signature of method: Script578$_run_closure1.call() is applicable for argument types: (String, com.atlassian.jira.issue.IssueImpl, ArrayList) values: [, XXX-1150, [1234, 4321, ...]] Possible solutions: any(), any(), dump(), grep(), collect(), find()

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.16.2
TAGS
AUG Leaders

Atlassian Community Events