Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-74290

GET /rest/api/2/version on Jira 9.2 has inconsistent behavior on archived releases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 9.2.0
    • REST API

    Description

      Issue Summary

      The experimental method 'GET /rest/api/2/version', introduced on Jira version 9.2.0 and listed on Jira rest api documentation, leads to inconsistent behavior for archived releases.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create some release versions (note some to be archived)
      2. Associate bug issues to some release versions to be archived
      3. Archive some bug issues previously associated with release versions to be archived
      4. Archive the release versions
      5. Note the rest API will bring inconsistent values for some, such as versions not present or incorrect data displayed

      The versions in Jira UI:

      Data retrieved from rest call :

      % curl -u xxxx:yyyy -X GET "http://localhost:8080/rest/api/latest/version" |  python3 -mjson.tool
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  1469    0  1469    0     0  12526      0 --:--:-- --:--:-- --:--:-- 13477
      {
          "maxResults": 100,
          "startAt": 0,
          "total": 7,
          "isLast": true,
          "values": [
              {
                  "self": "http://localhost:8080/rest/api/2/version/10101",
                  "id": "10101",
                  "description": "Version 1.0",
                  "name": "1.0",
                  "archived": false,
                  "released": false,
                  "projectId": 10301
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10102",
                  "id": "10102",
                  "description": "Version 1.1 candidate",
                  "name": "1.1 candidate",
                  "archived": false,
                  "released": false,
                  "projectId": 10301
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10000",
                  "id": "10000",
                  "description": "FixVersion1",
                  "name": "FixVersion1",
                  "archived": false,
                  "released": true,
                  "projectId": 10301
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10001",
                  "id": "10001",
                  "description": "FixVersion2",
                  "name": "FixVersion2",
                  "archived": false,
                  "released": false,
                  "projectId": 10301
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10100",
                  "id": "10100",
                  "name": "Version2",
                  "archived": false,
                  "released": true,
                  "releaseDate": "2022-07-25",
                  "userReleaseDate": "25/Jul/22",
                  "projectId": 10301
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10203",
                  "id": "10203",
                  "name": "Version4",
                  "archived": false,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10204",
                  "id": "10204",
                  "name": "Version5",
                  "archived": false,
                  "released": true,
                  "projectId": 10000
              }
          ]
      }
      

      Note:

      • Version1 is not listed
      • Version2 has incorrect archived status
      • Version3 is not listed
      • Version6 is not listed
      • All Version(WOIssuesandReleasd|WithIssues|WOIssues) are not listed. 
      • The projectId  is incorrect for Version2, where it should be 10000 (as the others). 

      All tests were performed after reindex.

      Expected Results

      All release versions with correct information.

      Actual Results

      Inconsistent data return and incorrect values.

      Workaround

      Currently there is no known workaround for this behavior when listing all versions.

      If filtering by project (/rest/api/2/project/<project>/version) or consulting the version directly (/rest/api/2/project/version/id) the data is returned as expected.

      Example:

      curl -u xxx:yyyy -X GET "http://localhost:8080/rest/api/latest/version/10200" |  python3 -mjson.tool
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   138    0   138    0     0   7952      0 --:--:-- --:--:-- --:--:-- 17250
      {
          "self": "http://localhost:8080/rest/api/2/version/10200",
          "id": "10200",
          "name": "Version1",
          "archived": true,
          "released": true,
          "projectId": 10000
      }
      
      curl -u xxx:yyyy -X GET "http://localhost:8080/rest/api/latest/project/KBB/version" |  python3 -mjson.tool
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  1442    0  1442    0     0  50552      0 --:--:-- --:--:-- --:--:-- 72100
      {
          "self": "http://localhost:8080/rest/api/2/project/KBB/version?maxResults=50&startAt=0",
          "maxResults": 50,
          "startAt": 0,
          "total": 9,
          "isLast": true,
          "values": [
              {
                  "self": "http://localhost:8080/rest/api/2/version/10200",
                  "id": "10200",
                  "name": "Version1",
                  "archived": true,
                  "released": true,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10201",
                  "id": "10201",
                  "name": "Version2",
                  "archived": true,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10202",
                  "id": "10202",
                  "name": "Version3",
                  "archived": true,
                  "released": true,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10203",
                  "id": "10203",
                  "name": "Version4",
                  "archived": false,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10204",
                  "id": "10204",
                  "name": "Version5",
                  "archived": false,
                  "released": true,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10300",
                  "id": "10300",
                  "name": "Version6",
                  "archived": true,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10301",
                  "id": "10301",
                  "name": "VersionWOIssues",
                  "archived": true,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10302",
                  "id": "10302",
                  "name": "VersionWithIssues",
                  "archived": true,
                  "released": false,
                  "projectId": 10000
              },
              {
                  "self": "http://localhost:8080/rest/api/2/version/10303",
                  "id": "10303",
                  "name": "VersionWOIssuesAndReleased",
                  "archived": true,
                  "released": true,
                  "projectId": 10000
              }
          ]
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              b99328de92bd Douglas Alves
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: