It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Database Custom Field not working with custom field parameter

I have a query where I want to add a static row to a return.  I am doing a UNION to add in the extra row.  Below is the query.  It returns data just fine when i hardcode 526595 for the customfield value

 

SELECT
p.program_name AS pname,
p.program_key AS pkey
FROM
program p
WHERE
p.client_number = {customfield_10428}
UNION
SELECT
"ALL PROGRAMS" AS pname,
p.client_number AS pkey
FROM
program p
WHERE
p.client_number = {customfield_10428}

 

Is there something wrong with my query when I change to a custom field?  Also, when i try to revert back to one that worked prior, it errors out for a bit.  Does something cache the config for a bit?   Is there a log I can check?  Nothing is showing in the atlassian-jira.log file.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted

Hi Dave,

What type of custom field is customfield_10428? You can see the supported fields for dynamic queries here:  https://confluence.kepler-rominfo.com/pages/viewpage.action?pageId=4161561

 

Best Regards,
Alexandra 

It is a text field.  the program_key field is an integer.  I tried doing CAST({customfield_10428} as INT).  It worked when querying the DB (using '526595' for the custom field) just fine.

SELECT
p.program_name, p.program_key
FROM
program p

WHERE
p.client_number = {customfield_10428}
order by p.program_name asc

 

This exact query works from one server, but not another.  There are other connections to the database that are working on both servers.

Try to set the log level to DEBUG as described here: https://confluence.kepler-rominfo.com/display/JJUP30/Configure+JIRA+Logging and check for some relevant information. smile

Is there a specific logging level I can turn on/up to see what is being sent to the database?

Yes, set it on debug.

i tried debug and trace.  I am not seeing my query anywhere in atlassian-jira.log

well, it was a stupid plugin trick (I refuse to call it a stupid HUMAN trick here)

That custom field was not on the screen, even though it was being populated on the back end.  Adding it to the screen fixed it.

 

Resolving as turning up the logging helped identify.   Thanks!

Hello
Can you explain this solution better?

Thanks

Community showcase
Published in Training & Certification

Introducing Atlassian University Live!

Atlassian University is committed to providing the best training and certification for Atlassian products through on-demand classes, in-person team training, a world-class certification program, and ...

195 views 3 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you