I'm trying to import rev history by creating items and attaching files and properties. Everything works fine except that previous revisions are stuck in 'Work In Progress'. I've turned off bump revision since that assigns the next revision in the revision scheme and I need to skip revisions in many cases. I have to change the state to 'Work In Progress' to assign the revision but I can't change the previous revisions lifecycle back to Released. Only the Latest revision gets 'Released'. I've even tried using GetItemByItemNumberAndRevisionNumber to get the previous revisions RevID to pass to UpdateLifecycleStates but only the Latest rev gets Released. I've confirmed using this method returns a previous RevID than the Later Revisions RevId, but no joy.
Is this by design or am I doing something wrong or out of order? Is there a slightly different workflow I could use?
Thanks
Solved! Go to Solution.
Solved by dvsmiller9. Go to Solution.
Solved by Redmond.D. Go to Solution.
Good question. Let me just make sure I understand the issue. You are using the following algorithm to add items...
When you are done and you look at the item history, you see a bunch of revisions in the WIP state. You want to see only Released revisions.
Solution:
From the UI, you can run the Purge command, which will remove all WIP states, leaving the Released state for all previous revisions. From the API, you call DeleteItemVersionsByMasterItemIds.
Details:
Items have versions just like files do. Every edit you do creates a new item version. This includes setting properties, changing the lifecycle and changing the revision number. For the most part, you don't see these versions. When the Vault client displays a revision, it's really displaying the highest version within the revision. So the Released version you created in step 3 is there, but it's just hidden by the version from step 4. Running the Purge command deletes the WIP version, leaving the Released version as the highest one for that revision.