Set Lifecycle State and Revision via API

Set Lifecycle State and Revision via API

ForrestJudd
Advocate Advocate
881 Views
3 Replies
Message 1 of 4

Set Lifecycle State and Revision via API

ForrestJudd
Advocate
Advocate

I am trying to bulk-load Items into a Revision Controlled workspace. I have no problem creating the items, populating fields, adding attachments, etc.

 

However, I need to mark the records as 'released' with their current revision value. This means I need to specify a Lifecycle State and Revision for the Items at some point. Can this be done to the Items directly via either the v1 or v3 API?

 

I could certainly add the Items to a Revisioning record and manipulate that record's workflow, but doing that for thousands of part numbers in a short period of time sounds like a good way to run into server performance limitations or timeouts.

 

I saw this forum post with a reference to using a PUT to a v1 endpoint on the item specifying a URI like so:

 

[workspace]/[itemid]/lifecycles/transitions/[lifecycletransitionid]

 

And passing an XML body specifying the revision value, but that didn't work for me. And that also doesn't allow setting an effectivity and release date. I don't need to set any specific dates for effectivity, though, I just need to get these Items into a 'released' state with the correct revision.

0 Likes
Accepted solutions (1)
882 Views
3 Replies
Replies (3)
Message 2 of 4

tony.mandatori
Autodesk
Autodesk

I've used this API before. There is no equivalent in v3 that I know of.

 

0 Likes
Message 3 of 4

tony.mandatori
Autodesk
Autodesk
Accepted solution

The Content-Type should be application/xml

 

And the payload should look like this:

 

<dmsVersionItem>
<release>
A
</release>
</dmsVersionItem>

 

URL should be something like this

/api/rest/v1/workspaces/57/items/9153/lifecycles/transitions/14

 

Where the transitionID is obtained from 

 

/api/rest/v1/workspaces/{id:[0-9]*}/items/{dmsID:[0-9]*}/lifecycles/transitions 

Message 4 of 4

ForrestJudd
Advocate
Advocate

This worked perfectly, thanks!

0 Likes