0

Hoping someone could shed some light as my searches have turned up very little information.

I want to use Redmine's REST API for Issues to do:

  1. GET /issues/[id].json to get the content of a specific issue.
  2. Make changes to the above content.
  3. Finally PUT /issues/[id].json the content back.

But I want to perform this using some form of concurrency control (ideally optimistic locking), so that content isn't changed by someone else around 2, promptly followed by 3 destroying said change.

This link hints on such possibility:

I'd assume there'd be some way of specifying a compare value, possibly updated_on, to do compare-and-swap-esk locking with PUT /issues/[id].json, but I can't find anything regarding this.

Redmine's web interface provides a concurrency control mechanism, so I'm stumped as to why there's so little information on this.

antak
  • 19,481
  • 9
  • 72
  • 80
  • Standard concurrency control mechanism works the same way in html web interface and in API calls. You should get an error when trying to save a stale object: https://github.com/redmine/redmine/blob/master/app/controllers/issues_controller.rb#L181 – Nanego May 28 '15 at 21:20
  • I can't seem to find a way to make that fire via the API. (I tried adding things like `version`, `last_journal_id`, etc. to the issue JSON when `PUT`ing.) I did however find `409 Conflict` documented for wikis: http://www.redmine.org/projects/redmine/wiki/Rest_WikiPages#Creating-or-updating-a-wiki-page. – antak May 29 '15 at 07:34

0 Answers0