Forums

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

Database picker search SQL based on custom field

alex September 14, 2020

Hello
Could you help me.
I need get value from sql. I wrote script. but value in database picker not value and show error.


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_13001")

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


 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
alex September 14, 2020

I resolve problem.

agustin-barreto
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!
October 22, 2020

Hi alex, can you share how did you solve this?

 

Thanks,

Agustín

Himanshi Maheshwari January 28, 2021

how did you resolved this. Please share

TAGS
AUG Leaders

Atlassian Community Events