Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ScriptRunner Database picker Search SQL

alex September 21, 2020

Hello.
Could you help me.  I reading  https://scriptrunner.adaptavist.com/6.9.0/jira/script-fields/database-picker.html#_setting_search_sql_based_on_issue_fields  and  wrote the script, but in customfield many value, i have error. 

Uncaught exception thrown by REST service: Cannot get property 'sql' on null object
java.lang.NullPointerException: Cannot get property 'sql' on null object

 

import com.onresolve.scriptrunner.canned.jira.fields.editable.database.SqlWithParameters
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def lotTovara = customFieldManager.getCustomFieldObject("customfield_15505")

getSearchSql = { String inputValue, Issue issue ->
for(value in issue.getCustomFieldValue(lotTovara)){
new SqlWithParameters("select OFFCNT_CODE, OFFCNT_NAME from KSAS_DCT.OFFER_CONTENT WHERE OFFCNT_NAME like '%' || ? || '%' and OFFCNT_NAME like '%' || ? || '%'", [value ?: '', inputValue])
}
}

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events