Release Notes and Announcements

Expand all | Collapse all

Move item with REST API seems not always ok.

  • 1.  Move item with REST API seems not always ok.

    Posted 10-09-2018 12:33
    For place items at correct position, we move items by getting back the json and replace the item value in parent location.

    For example :

    "location": { "sortOrder": 0, "globalSortOrder": 98266402, "sequence": "8.1", "parent": { "item": 7243 } }

    becomes :

    "location": { "sortOrder": 0, "globalSortOrder": 98266402, "sequence": "8.1", "parent": { "item": 7245 } }

    And we send the new json by a put request to the item to update.

    We have to do this many times adn mive items to temporary parent when we want to reorder the children.

    When using an  older version of Jama. May be

    ------------------------------
    Garros JP
    ------------------------------


  • 2.  RE: Move item with REST API seems not always ok.

    Posted 10-10-2018 04:17
    I did more test.

    And by just adding a thread sleep(1000) before each request I send all is ok.
    Without this thread sleep I got my children with bad order and sometimes the following errors :
    Exception occurred
    org.apache.wink.client.ClientRuntimeException: Connection to the move of item https://sodius.jamacloud.com/rest/latest/items/53323 failed (HTTP 500 Internal Server Error - could not execute batch)

    It seems Jama treat the Delete request before a put one and so on my request to move done by a put fails as the item is no more present. By verifying the children it lacks an item.

    From my point of view this is due to a change on how Jama treat the received  REST API. May be a queue or something else has been introduced and the request are not treated in a synchronous way if too many requests are sent.

    ------------------------------
    Garros JP
    ------------------------------



  • 3.  RE: Move item with REST API seems not always ok.

    Posted 10-10-2018 05:23
    No adding the thread sleep didn't works. My test sometimes works sometimes fails.

    ------------------------------
    Garros JP
    ------------------------------



  • 4.  RE: Move item with REST API seems not always ok.

    Posted 10-10-2018 10:02
    After more and more investigation it seems thaht the request done for moving an item from a parent to an other didn't works perfeclty. Sometimes no problems but many times I encounter issues. For example mofing an item to an other parent. The move says ok but the items disseapears from Jama. Is there any other way to move items with REST API ?

    ------------------------------
    Garros JP
    ------------------------------



  • 5.  RE: Move item with REST API seems not always ok.

    Posted 10-10-2018 10:55
    Why the rest API just allow to do a

    put /items/{id}/location


    but this only works with project not item. that's why I suspect the move request we done to do not work anymore because may be some check has done to move item. And that's why Jama could not also do the move to an item.

    ------------------------------
    Garros JP
    ------------------------------