You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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])
}
}