SQL Query all changes of given custom field last 24 hours post JIra 6.0

I had nice query to pull the change data for a custom field for last 24 hours post update from 5.11 to 6.3 the query is broken since the 'pkey' field is not longer used.

 

SELECT
changegroup.created as "Updated",
jiraissue.pkey,
cwd_user.display_name as "Changed by",
changeitem.oldstring as "Old Version",
changeitem.newstring as "New Version"
FROM changeitem
INNER JOIN changegroup ON changegroup.ID = changeitem.groupid
INNER JOIN jiraissue ON changegroup.issueid = jiraissue.id
INNER JOIN cwd_user on changegroup.author = cwd_user.user_name
WHERE
"public".changeitem.field = 'Target Version' AND
"public".changegroup.created >= now() - INTERVAL '1 DAY'
ORDER BY
"public".jiraissue.created DESC

 

 

1 answer

1 accepted

Replace "issue.pkey" by "project.pkey + '-' + CAST(jiraissue.issuenum AS varchar(9))"

and add join "inner join project on jiraissue.project = project.id"

This is SQL Server SQL code, you can easily adapt for other databases... smile

Thanks for the help worked

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 4 hours ago in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

17 views 0 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you