iceScrum | Cannot get REST API to update startDate – iceScrum

iceScrum Foros Discutir de iceScrum

Viendo 8 entradas - de la 1 a la 8 (de un total de 8)

  • Autor
    Entradas
  • #10715

    Kagilum
    Superadministrador

    I am trying to update the startDate for my project. It somehow ended up one month ahead of the activation date and we would like to «close» the sprint on the actual date for record keeping purposes.

    I am using this command with the REST API:

    curl -X -H «Accept: application/json» -u user:pwd –request PUT -d «sprint.startDate=05072015» –verbose http://icescrum.example.com/icescrum/ws/p/INFRA/sprint/1106

    and I keep getting this error:

    {«notice»:{«text»:»Cannot get property ‘version’ on null object»}}

    I have tried formatting the dates with slashes (MM/dd/yyyy) and datetime format (2015-05-06T00:00:00Z) and I still get this error.

    Attached is a full stack trace. Can you help us set the date to what it should be (04/29/2015? We have the ability to update the database as well.

    #11086

    Nicolas Noullet
    Superadministrador

    There are two different problems here:

    – Updating dates for record keeping purposes

    I am sorry but I did not understand your issue. I am not an English native speaker so this may affect my understanding. Could you please rephrase it by providing the current state of the dates and the state you want to reach?

    Please note that using the API will not work around business rules enforced in the GUI so if you cannot update a date in the GUI then you will not be able to do so through the API. The only way to bypass the business rules consists in updating the database records manually but this should be avoided as much as possible in order to prevent inconsistencies, instabilities, data loss…

    – Updating the sprint start date through the API

    The problem here is that you provide a body of Content-Type «application/x-www-form-urlencoded». The API only accepts JSON and XML formats as output and input. That means that if you provide a body with the request then it must be either in JSON or XML, as explained in the documentation: https://www.icescrum.com/documentation/icescrum-api/#summary_6.

    Regarding the date format, as explained in the documentation: https://www.icescrum.com/documentation/icescrum-api/sprint-api/, if your user uses the EN-US locale then the format is MM/dd/yyyy.

    Here is an example of cURL command that is more likely to succeed:

    curl -X PUT -H "Content-Type: application/json" -u user:pwd -d '{ "sprint": {"startDate": "04/29/2015"} }' http://icescrum.example.com/icescrum/ws/p/INFRA/sprint/1106
    #11087

    Kagilum
    Superadministrador

    Nicolas,
    Thank you for updating my curl command.

    As you mentioned, since the GUI will not let us update the startDate once the sprint has been activated, neither will the API.

    Any suggestions for how to fix the original problem? Below is a reworded description:

    We have a project that was setup and activated on 04/29/2015. The startDate somehow ended up being set to 05/30/2015 rather than the ideal 04/30/2015. Due to this problem, we cannot close the sprint because the endDate is before the startDate.

    Can you point us to the database tables we would need to update? Otherwise we will not be able to close this sprint and start a new one until 06/15/2015.

    #11089

    Nicolas Noullet
    Superadministrador

    First, it is important to understand the model, which is designed in an object oriented fashion. Sprints and releases are represented by the classes Sprint and Release, which both inherit from an abstract class named Timebox, which gives them the startDate and endDate attributes.

    In the DB, the Sprint class is represented as the icescrum2_sprint table, the Release class is represented as the icescrum2_release table and the Timebox abstract class is represented as the icescrum2_timebox table.

    That means that for every sprint and every release, there is a row in there respective table and another row with the same id in the icescrum2_timebox table that stores its startDate and endDate under the start_date and end_date columns.

    First, stop iceScrum and make a DB backup. Then, you will need to update the icescrum2_timebox table for the sprint. I recommend that you also check that the release startDate is correct (a sprint cannot start before the first day of the release). Finally, start iceScrum.

    #11090

    Kagilum
    Superadministrador

    Nicolas,
    We tried your solution yesterday and it worked! Thank you so much!

    #11091

    Nicolas Noullet
    Superadministrador

    Glad to know that it worked! 🙂

    #14717

    Hi I would like to create a Task using REST API on my local instance but I am not able to use the curl command with REST API,

    Can You Please Tell me the way how can I Use this …

    #14733

    Vincent Barrier
    Superadministrador

    Hey,

    Please don’t post on each topic. -_-‘

    Follow the documentation about REST API and it should be ok. REST API

Viendo 8 entradas - de la 1 a la 8 (de un total de 8)

El foro ‘Questions and help’ está cerrado y no se permiten nuevos debates ni respuestas.