Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Can revert action on working revision be invoked through a script or API?

mpasumarti
Advocate

Can revert action on working revision be invoked through a script or API?

mpasumarti
Advocate
Advocate

We have couple of scenarios wherein we want to restore working revision/version of an item to be the same as it's latest released revision. i.e, overriding the working revision with latest released revision after certain changes were made to released revision. 

I didn't find any trace of calling/invoking Revert action on working revision neither in server-side scripting reference nor in REST API reference and started wondering if there is another way to implement it?

 


Thanks,
Madhav
Reply
944 Views
5 Replies
Replies (5)

andrew.pitman
Contributor
Contributor

Good question. I also had this query.

 

Does anyone know the answer?

giliar.defriesperez
Autodesk
Autodesk

@andrew.pitman @mpasumarti 

 

This is not currently supported via the API (v1 or v3).

 

Thanks,

 

Giliar


Giliar de Fries Perez
Sr. Product Owner
Fusion 360® Manage
Autodesk Canada Co.
0 Likes

andrew.pitman
Contributor
Contributor

Thanks @giliar.defriesperez .

 

I was speaking to our consultant, @ian.slater, and we have devised a work-around through scripting.

 

Cheers

 

 

0 Likes

Adrian.GrischottMLEX9
Advocate
Advocate

What was the workaround?

0 Likes

philipfrench
Collaborator
Collaborator

You can do it with API:

POST /api/v3/workspaces/WSID/items/DMSID/reverts (DMSID is the working revision)

payload is this 2-char string:
{}

Success seems to be a 303 (redirect) and failure a 404.

But it is not documented, and from the payload and return details, I would assume this was developed for the browser only.
Whether Autodesk would support its use, you would need to ask them.

You can call APIs from the javascript interface with some auth, impersonate, etc, but I imagine that if you tried to trigger this /reverts from eg an on-demand / on-edit on the working revision itself (or his predecessor), I imagine it will fail with a deadlock.
But I didn't try this myself. You would need to trigger this from another item, eg a CO.

 

You could simulate this by just copying using javascript: get the working revision (loop item.dvi.revisionList) of your current item (the working revision) and copying whichever fields you want from him, and perhaps the bom children or whatever. But you are not going to be able to revert the attachments tab in this way, nor will it prevent this record from being selected in any future Change Order when using the 'add affected children that are modified' option.