The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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