How to find the current fixVersion of an issue.

Kannan Sundararaj April 14, 2014

I see two rows for an issue in the nodeassociation table which implies that the issue was moved from one fixVersion to another fixVersion. Am i right?

If so how do i find the current fixVersion of the issue.

Is this detail present in the "jiraissue" table or any other table.

Your answers please...

1 answer

1 accepted

1 vote
Answer accepted
Andris Grinbergs
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.
April 14, 2014

You can get FixVersion from changeitem table.

Andris Grinbergs
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.
April 14, 2014

This what happens in database when FixVersion is set for issue:

INSERT INTO nodeassociation (SOURCE_NODE_ID, SOURCE_NODE_ENTITY, SINK_NODE_ID, SINK_NODE_ENTITY, ASSOCIATION_TYPE, SEQUENCE) VALUES (90600, 'Issue', 10001, 'Version', 'IssueFixVersion', null)

--

UPDATE jiraissue SET UPDATED='2014-04-15 10:01:55' WHERE ID=90600

--

INSERT INTO changegroup (ID, issueid, AUTHOR, CREATED) VALUES (412705, 90600, 'admin', '2014-04-15 10:01:55')

--

INSERT INTO changeitem (ID, groupid, FIELDTYPE, FIELD, OLDVALUE, OLDSTRING, NEWVALUE, NEWSTRING) VALUES (556908, 412705, 'jira', 'Fix Version', null, null, '10001', 'version 2')

Kannan Sundararaj April 15, 2014

Can you please tell me what will be the values in the "OLDVALUE, OLDSTRING, NEWVALUE, NEWSTRING" when the issue is moved to another version?

Andris Grinbergs
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.
April 15, 2014

It's previous value (fix version). Anyway you can get all history of "Fix Version" for a particular issue with this:

select
*
from
changegroup, changeitem, jiraissue

where
(changegroup.id=changeitem.groupid) and
(jiraissue.id=changegroup.issueid) and
(changeitem.field='Fix Version') and
(jiraissue.pkey='IS-444');

Where IS-444 is issue key for which you want history.

Just filter newest entry and you will get current "Fix Version".

Andris Grinbergs
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.
April 15, 2014

If that helps, you may probably want to mark this issue as answered. :)

Kannan Sundararaj April 15, 2014

when i gave the following query

 

select * from changeitem where field='Fix Version' and fieldtype='jira' 
and OLDVALUE is not null and OLDSTRING is not null and NEWVALUE
 is not null and NEWSTRING is not null

i dont get any rows at all.

But there are some issues which were moved to other versions from their original version.So i am bit confused now.

Andris Grinbergs
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.
April 15, 2014

It's probably caused, because at one moment in between version switch there were no Fix Version. It usually happens when you remove old version and add new version. In database it's written as 2 transitions:
* old=v1 new=null
* old=null new=v2

Kannan Sundararaj April 15, 2014

Thanks this is what i was expecting :-)

Kannan Sundararaj April 15, 2014

but i see only one row in nodeassociation table for one issue which is moved from one version to another version . So i guess this table will be updated everytime the version is changed. Am i right?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2014

Yes, the point of the line in the table is that it shows the current version(s)

Suggest an answer

Log in or Sign up to answer