Database custom field error in Postgresql

Madhura A S December 3, 2018

Hi,

I am using Database custom field plugin from CPrime.  Below is the postgres sql query for the database custom field "Error Details"

select ErrorGroupsQACE.ErrorDef from ErrorGroupsQACE where ErrorGroupsQACE.ErrorCode = CAST ({customfield_13804} as numeric) and ErrorGroupsQACE.Status = 'Active'

It is listing the correct values on the Jira issue creation screen. But problem is that whenever I choose the option in the Error Details  field, error message getting logged into the jira log file as below

ERROR madhura 184x10946x1 ewcjn 10.0.70.48,127.0.0.1 /secure/QuickCreateIssue!default.jspa [c.k.j.p.d.querydb.impl.QueryDatabaseImpl] Could not execute SQL query >>select ErrorGroupsQACE.ErrorDef from ErrorGroupsQACE
where ErrorGroupsQACE.ErrorCode = CAST (? as numeric) and ErrorGroupsQACE.Status = 'Active'<< on database JIRAPRODPG.
org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: ""

 

Please let me know if i am missing something in sql query?

 

Regards,

Madhura 

1 answer

1 accepted

0 votes
Answer accepted
Madhura A S December 3, 2018

I resolved it by changing the type cast in the query as below

select ErrorGroupsQACE.ErrorDef from ErrorGroupsQACE where CAST(ErrorGroupsQACE.ErrorCode varchar) = CAST ({customfield_13804} as varchar) and ErrorGroupsQACE.Status = 'Active'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events