Custom field created as Version Picker - SQL Query in database

Ankit Kothari December 4, 2012

Hi,

I have created a custom field (for eg. Release) of type single version picker.

I have created many issues and set this field. Now, I want to search for all JIRA issues for a particular release. Since, I am writing reports in BIRT, I need an SQL query.

I am able to fetch the values for all other custom values, but not for this field. (I have created 3 more fields of type version picker.)

Could you please provide me help on this? May be a sample SQL query or the table which will hold the link to the jiraissue and the value of the release custom field.

Any help on this would be appreciated.

Thanks,

Ankit

1 answer

1 accepted

0 votes
Answer accepted
Adam Jacobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2012

I think this should get you started:

SELECT 
  jiraissue.pkey,projectversion.vname
FROM 
  jiraissue,projectversion,customfieldvalue,customfield
WHERE 
  customfieldvalue.issue = jiraissue.id AND
  customfieldvalue.customfield = customfield.id AND
  customfieldvalue.numbervalue = projectversion.id

As for turning the issue reference (pkey) into an HTML link, you could probably use a string operator such as:

SELECT '<a href="https://jira.yourdomain.com/browse/' || jiraissue.pkey || '">' || jiraissue.pkey || '</a>' AS "Issue No.",

Hope that helps.

Ankit Kothari December 4, 2012

Awesome... the "numbervalue" did all the trick. I was using "stringvalue". Thanks a much.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events