Marcel Stör
Marcel Stör

Reputation: 23565

Jira REST API not respecting 'query' param for versions

According to https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-versions/#api-group-project-versions the Jira v2 REST API supports a query param for project versions.

Filter the results using a literal string. Versions with matching name or description are returned (case insensitive).

I can't seem to make this work as advertised.

https://my-jira-host/rest/api/2/project/project-key/version?query=july&orderBy=name returns versions that have nothing to do with "july" at all.

{
  "self": "https://my-jira-host/rest/api/2/project/project-key/version?maxResults=50&orderBy=name&startAt=0",
  "nextPage": "https://my-jira-host/rest/api/2/project/project-key/version?maxResults=50&orderBy=name&startAt=50",
  "maxResults": 50,
  "startAt": 0,
  "total": 56,
  "isLast": false,
  "values": [
    {
      "self": "https://my-jira-host/rest/api/2/version/10302",
      "id": "10302",
      "name": "2017.07 Phoenix",
      "archived": false,
      "released": true,
      "startDate": "2017-07-03",
      "releaseDate": "2017-07-31",
      "userStartDate": "03/Jul/17",
      "userReleaseDate": "31/Jul/17",
      "projectId": 10607
    },
    {
      "self": "https://my-jira-host/rest/api/2/version/10303",
      "id": "10303",
      "name": "2017.08 Zelos",
      "archived": false,
      "released": true,
      "startDate": "2017-08-01",
      "releaseDate": "2017-08-31",
      "userStartDate": "01/Aug/17",
      "userReleaseDate": "31/Aug/17",
      "projectId": 10607
    },
    {
      "self": "https://my-jira-host/rest/api/2/version/10304",
      "id": "10304",
      "name": "2017.09 Horen",
      "archived": false,
      "released": true,
      "startDate": "2017-09-01",
      "releaseDate": "2017-09-30",
      "userStartDate": "01/Sep/17",
      "userReleaseDate": "30/Sep/17",
      "projectId": 10607
    },

Upvotes: 1

Views: 759

Answers (1)

Marcel Stör
Marcel Stör

Reputation: 23565

Turns out I was looking at the wrong documentation - Jira Cloud instead of Jira Server. The later doesn't support the query parameter.

Source: https://docs.atlassian.com/software/jira/docs/api/REST/9.0.0/#project-getProjectVersionsPaginated

Upvotes: 2

Related Questions