OpenProjectExcel icon indicating copy to clipboard operation
OpenProjectExcel copied to clipboard

Manual ordering column

Open olivierdalang opened this issue 6 years ago • 3 comments

Hi !

It is currently not possible to get/set the manual ordering value.

It would be very useful, as it would allow to make up for some OP gaps (e.g. sorting lost when cloning projects, somewhat unreliable drag&drop, etc.). It would also allow to replicate exactly the hierarchy on the platform using the new sort by hierarchy feature #14.

Cheers,

Olivier

olivierdalang avatar Jan 13 '20 16:01 olivierdalang

Hi @olivierdalang ,

as far as I know this information is not provided by APIv3.

@ulferts @oliverguenther Am I missing something? Is there any way for me to get this informtion in a neat way?

Best

Bernd

bpetraus avatar Jan 23 '20 11:01 bpetraus

@bpetraus the information is available via the APIv3 (although I must confess it is not document, and given that it does not follow the structure of the v3, for good reason).

The order does only exist for persisted queries. Given a query has been persisted, the order can be fetched via:

GET /api/v3/queries/:id/order

A hash is returned e.g. like

{ "2664" : 32768, "2661" : 57348, "2665" : 49152, "2662" : 53250, "2663" : 55299 }

The first value is the id of the work package and the second is the priority. The lower the number, the higher its position in list. Please note that not every work package returned by the query has to have an entry in the order response as the result set can change whenever a work package is added. Work packages without a mention in the order list are appended.

ulferts avatar Jan 23 '20 13:01 ulferts

@ulferts Thank you! @olivierdalang I will implement this function, but dont know exactly when.

bpetraus avatar Jan 24 '20 08:01 bpetraus