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.
Community moderators have prevented the ability to post new answers.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a specific logging level I can turn on/up to see what is being sent to the database?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, set it on debug.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i tried debug and trace. I am not seeing my query anywhere in atlassian-jira.log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.