Unable to update the 'State' of an asset in RAM using REST API
![]()
I am using RAM 7.5.1. And REST API to modify the asset present in the RAM server.
Are there any ways to modify the state of an asset using REST API? |
Accepted answer
![]()
Rich Kulp (3.6k●3●8)
| answered Jan 30 '13, 10:29 a.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Jan 30 '13, 11:21 a.m.
This is basically internal and hasn't been published as API but this is how it currently works. We don't see a change in the future at this time but we can't guarantee it.
Now I haven't done this but the basics according to the code is you need to: 1) Get the available actions for the asset in the current state. 2) Decide on the action you want to do. 3) Do a REST PUT with the action as a parameter to actually cause the update to occur to the next state. 0) -- GET ...internal/assets/{3691A889-9D1C-17BA-6EEB-DD5FB50FA2E6}/4.0 with Accept header set to "application/xml" or "application/json" which ever you prefer 1) -- GET ...internal/assets/{3691A889-9D1C-17BA-6EEB-DD5FB50FA2E6}/4.0/availableActions with Accept header set to "application/xml" or "application/json" which ever you prefer 2) -- Go through the results to get the desired action 3) -- PUT ...internal/assets/{3691A889-9D1C-17BA-6EEB-DD5FB50FA2E6}/4.0 with "action" header set to the action id that you choose from (2) and with ContentType header set to "application/xml" or "application/json" which ever you prefer with content sent being the same content as returned from (0). Note also that there is a defect around driving a retire from API: Java API to retire an asset (drive the Retire action) will not work properly (79583) Basavaraj Wadi selected this answer as the correct answer
Comments Hi Richard, ThanksĀ for your reply... I tried the steps you mentioned above using the REST client and i got the following error (and I used 'application/xml' and Action:Publish as header):
<oslc:statusCode>500</oslc:statusCode>
What the logs (ramDebug.log) on the server for the 500 above?
The logs should give more info, but that basically means that your lifecycle for that asset is configured to require some other condition, like maybe a reviewer voting on it, before the action is allowed to be performed.
Hi Richard,
API can not override a criteria set on your lifecycle.... you will need to either meet the criteria, or modify it to be able to transition to the next state.
Is this API available for version 7.2, I am also trying to change the state but nothing is happening, nor I am getting any error.
showing 5 of 6
show 1 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.