Prevent field values from being set to NULL if value isn't passed via sprint update REST API calls

XMLWordPrintable

    • 1

      Issue Summary

      When using Jira Data Center REST API to update a sprint fully, if the PUT request doesn't include value passed for optional field originBoardId, it will set the value to NULL. This will cause the sprint to be removed from the associated board and our documentation states that this is expected behavior:

      Update a sprint fully
      Performs a full update of a sprint. A full update means that the result will be exactly the same as the request body.
      Any fields not present in the request JSON will be set to null.

      It's easy for clients to unintentionally NULL out fields when performing what they believe is a “partial” update (for example, only changing state).
      The impact in this case can be fairly severe (sprints silently losing their board association) and should be improved upon with this feature request.

      It would be great if our REST API can provide a safer “partial update” option for sprints (e.g., a PATCH-style endpoint or a mode in which omitted fields are left unchanged rather than set to null), or at least clearer documentation and warnings around the destructive semantics of PUT for this resource.

      Steps to Reproduce

      1.) Create a new sprint via REST API and associate it with a specific origin board:

      curl -X POST --user 'admin:sphere' \ 
      -H "Content-type: application/json" \ 
      -d '{"name":"Test Sprint", "originBoardId":"1"}' \
      "https://TestJira.net/jira/rest/agile/1.0/sprint?test"
      ...
      {"id":3,"self":"https://TestJira.net/jira/rest/agile/1.0/sprint/3","state":"future","name":"Test Sprint","originBoardId":1,"synced":false,"autoStartStop":false}}}

      2.) Response above shows it exists but we can check via this REST API GET or the UI:

      curl --request GET --user 'admin:sphere' \
      --header 'Accept: application/json' \
      "https://TestJira.net/jira/rest/agile/1.0/sprint/3"
      ...
      {"id":3,"self":"https://TestJira.net/jira/rest/agile/1.0/sprint/3","state":"future","name":"Test Sprint","originBoardId":1,"synced":false,"autoStartStop":false}}}

      3.) Update the sprint via REST API but don't include the originBoardId in the PUT:

      curl -X PUT --user 'admin:sphere' -H "Content-type: application/json" -d '{"name":"Test Sprint","startDate":"2025-12-12T14:23:00.000Z", "endDate":"2025-12-19T14:23:00.000Z","id":"3", "state":"active"}' \"https://TestJira.net/jira/rest/agile/1.0/sprint/3"
      ...
      {"id":3,"self":"https://TestJira.net/jira/rest/agile/1.0/sprint/3","state":"active","name":"Test Sprint","startDate":"2025-12-12T14:23:00.000Z","endDate":"2025-12-19T14:23:00.000Z","activatedDate":"2025-12-12T20:24:58.145Z","synced":false,"autoStartStop":false}}}

      4.) Response doesn't return a originBoardId and querying the sprint shows it's set to NULL:

      SELECT "ID", "NAME", "RAPID_VIEW_ID"
      FROM public."AO_60DB71_SPRINT"
      WHERE "RAPID_VIEW_ID" IS NULL 

      Expected Results

      Sprints fields passed via REST API are set and fields not included retain their original values without being updated.

      Actual Results

      Sprints fields passed via REST API are set and fields not included may have their values updated to NULL.

      Workaround

      The sprint can be associated with a board via REST API by passing the originBoardId or via SQL query:

      curl -X PUT \
      --user 'admin:sphere' \
      -H "Content-type: application/json" \
      -d '{"name":"Test Sprint","state":"active","originBoardId":"1", "startDate":"2025-12-12T14:23:00.000Z", "endDate":"2025-12-19T14:23:00.000Z"}' \
      "https://TestJira.net/jira/rest/agile/1.0/sprint/3"
      ...
      {"id":3,"self":"https://TestJira.net/jira/rest/agile/1.0/sprint/3","state":"active","name":"Test Sprint","startDate":"2025-12-12T14:23:00.000Z","endDate":"2025-12-19T14:23:00.000Z","activatedDate":"2025-12-12T20:56:15.637Z","originBoardId":1,"synced":false,"autoStartStop":false} 
      UPDATE "AO_60DB71_SPRINT" 
      SET  "RAPID_VIEW_ID" = 1 
      WHERE "ID" = 3

            Assignee:
            Unassigned
            Reporter:
            Adrian Castillo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: