ALM is checking out first version of the entity instead of latest one

  • KM01246311
  • 12-Nov-2014
  • 12-Nov-2014

Summary

ALM is checking out first version of VC entities like tests, reqs, test resources, etc. instead of latest one.

Error

ALM is checking out first version of VC entities like tests, reqs, test resources, etc. instead of latest one.

By using a query like the following we are able to determine what is the latest check-in version of an entity: i.e. test plan tests. 

SELECT TS_TEST_ID, TS_VC_VERSION_NUMBER, TS_VC_STATUS FROM TEST

For example, If wrong value is shown under TS_VC_VERSION_NUMBER (i.e. 1 instead of 5) ALM will check-out version number '1' which is not the latest one!

VC entities like Reqs, Test Resources, etc might also be affected by this so the query should be modified to accomodate to specific entity table.

Cause

max(TS_VC_VERSION_NUMBER) from td.HIST_TEST table is not matching TS_VC_VERSION_NUMBER as set on td.TEST table.

Fix

Fix For Tests:

Update td.test set TS_VC_VERSION_NUMBER = (select max(TS_VC_VERSION_NUMBER) from td.HIST_TEST where test.TS_TEST_ID=HIST_TEST.TS_TEST_ID) where TS_VC_STATUS = 'Checked_In'

Fix For Requirements:

update td.REQ set RQ_VC_VERSION_NUMBER = (select max(RQ_VC_VERSION_NUMBER) from td.HIST_REQ where REQ.RQ_REQ_ID=HIST_REQ.RQ_REQ_ID) where RQ_VC_STATUS = 'Checked_In'

 

For any other affected entity/table make use of the above queries as template and modify accordingly.