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])
}
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.