Hi,
I have been trying to use the Database Picker from Adaptavist to search on multiple attributes of a simple database.
The aim is to have a Database Picker field where users can start to enter part numbers or part descriptions and have the results filter to a single selection.
I have tested this searching on one attribute, say part number and works ok. It is connecting to a Microsoft SQL Server.
If I follow the examples to search on two attributes I get an error message on validation saying "The SQL statement should have exactly one parameter marker". But with this approach there will be more than one ? marker.
Search SQL is:
import com.onresolve.scriptrunner.canned.jira.fields.editable.database.SqlWithParameters
getSearchSql = { inputValue ->
new SqlWithParameters("select PartNumber, PartDescription from PartDetails where PartNumber like concat(lower(?), '%') or PartDescription like concat(lower(?), '%')", [inputValue, inputValue])
}
Could anyone offer any support on what could be wrong with this and why I get the error mentioned above?
I would also like to be able to do a true wildcard search allowing text from mid-description to filter the results. The approach at the moment requires the search to start with the entered characters. I.e. typing in "wire" would return "equipment wire black" in the results, not just results starting with "wire".
Thanks in advance!