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

How can I map changegroup, changeitem and jiraissue tables? Edited

..

3 answers

1 accepted

0 votes
Answer accepted

Please, step away from the database.  It is NOT designed for reporting in any shape, and there is almost certainly a much better way to do what you want.

Could you explain why you are looking at it?  And who gave you the terrible idea of using SQL to do it?

(If you must, then start with changegroup - it has an issue column which is the id of the jiraissue, and then the id column in changegroup is used to identify the changeitems in that group)

Got it. Thank you.

Strongly seconding the warning from @Nic Brough {Adaptavist}!!!

That said, some people like to poke around under the hood... :)

Our instance necessitates DB updates sometimes. We use SQL to redact potentially sensitive text without deleting tickets. (Just editing a field doesn't remove the old value from the history tab so sensitive text could still be visible.)

Here is the oracle SQL we use to join all these tables together to basically recreate a ticket's changelog.(Enter your ticket key on the last line) Check out the join clauses to answer your question.
(Works on Jira 6.1+)

SELECT
p.pkey||'-'||i.issuenum as "KEY",
ci.field,
cg.created as Modified,
dbms_lob.substr(ci.oldstring, 4000, 1) as OLD_String,
dbms_lob.substr(ci.newstring, 4000, 1) as NEW_String,
dbms_lob.substr(ci.oldvalue, 4000, 1) as OLD_Value,
dbms_lob.substr(ci.newvalue, 4000, 1) as NEW_Value,
ci.id as Change_Item_Id
FROM changeitem ci
JOIN changegroup cg on ci.groupid = cg.id
JOIN jiraissue i on cg.issueid = i.id
JOIN project p on i.project = p.id
WHERE p.pkey||'-'||I.issuenum in ('KEY-123')

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

365 views 1 3
Join discussion

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