[RTC] Is it possible to exclusively control work item updates by REST API(OSLC)?
I want to lock a Workitem when updating it using REST API.
|
Accepted answer
Ralph Schoon (63.6k●3●36●47)
| answered Oct 29 '19, 3:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 29 '19, 3:27 a.m. As far as I can tell,
Ralph Schoon selected this answer as the correct answer
Comments
HIROAKI JOSAKO
commented Oct 29 '19, 7:08 a.m.
Thanks Ralph.
In general locking is an even worse concept then not locking. If locks are not removed, they pose a higher risk of creating issues than having to redo an operation because of a racing condition.
There are many automation tools (and users) working against RTC servers. If it would be a problem I would have likely heard about it.
Summary, if you run into a racing condition, the tool detects the fact (based on some header information, I think [etag?]) and lets you know. Reread the work item, do the change again and try writing it again.
HIROAKI JOSAKO
commented Oct 31 '19, 5:18 a.m.
ETag!!
|
One other answer
It looks like you can lock work items from the WebUI. I am not sure if you would be able to perform a work item update via REST API with the lock on, but this is one way to lock the state of the relevant work items.
Does this help?
Comments That is no lock, that is a pre-condition that prevents saving a work item under certain conditions.
As far as I am aware, there is no "locking" mechanism for work items. You can refresh before you do a change. If there is a conflict you get a stale data exception (in the java API) and you have to refetch and retry.
HIROAKI JOSAKO
commented Oct 28 '19, 3:29 a.m.
Thanks Wark!!
HIROAKI JOSAKO
commented Oct 28 '19, 3:46 a.m.
Thanks Ralph ,follow!!
As far as I can tell, there is no locking mechanism. Regardless of how you implement it, REST or JAVA API, there are only limited options. You can detect a possible conflict e.g. based on the error. In case there is an error, determine if this could be a stale data error. In case it is, refresh/reload the work item redo the modification and try to save again.
HIROAKI JOSAKO
commented Oct 28 '19, 11:56 p.m.
limited options?
|
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.