Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Lifecycle to Released of previous Item Revisions

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
dvsmiller9
720 Views, 2 Replies

Changing Lifecycle to Released of previous Item Revisions

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

Tags (1)
2 REPLIES 2
Message 2 of 3
Redmond.D
in reply to: dvsmiller9

Good question.  Let me just make sure I understand the issue.  You are using the following algorithm to add items...

  1. Add item
  2. Set properties
  3. Change state to Released
  4. Change state to WIP (no revision bump)
  5. Change revision
  6. Go to step 2 and repeat.

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.

 



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 3
dvsmiller9
in reply to: dvsmiller9

That worked great! Thanks Doug.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report