This resource represents project versions. Use it to get, get lists of, create, update, move, merge, and delete project versions. This resource also provides counts of issues by version.

Hierarchy

  • CommonHttpService
    • ProjectVersionsService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns ProjectVersionsService

Methods

  • Deletes a project version.

    Alternative versions can be provided to update issues that use the deleted version in fixVersion, affectedVersion, or any version picker custom fields. If alternatives are not provided, occurrences of fixVersion, affectedVersion, and any version picker custom field, that contain the deleted version, are cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version being deleted.

    This operation can be accessed anonymously.

    Permissions required: Administer Jira global permission or Administer Projects project permission for the project that contains the version.

    Parameters

    Returns Promise<void>

    Returned if the version is deleted.

    POST /rest/api/3/version/{id}/removeAndSwap @scopes-current manage:jira-project @scopes-beta delete:project-version:jira, write:project-version:jira

  • Deletes a project version.

    Deprecated, use Delete and replace version that supports swapping version values in custom fields, in addition to the swapping for fixVersion and affectedVersion provided in this resource.

    Alternative versions can be provided to update issues that use the deleted version in fixVersion or affectedVersion. If alternatives are not provided, occurrences of fixVersion and affectedVersion that contain the deleted version are cleared.

    This operation can be accessed anonymously.

    Permissions required: Administer Jira global permission or Administer Projects project permission for the project that contains the version.

    Parameters

    • params: {
          id: string;
          moveAffectedIssuesTo?: string;
          moveFixIssuesTo?: string;
      }
      • id: string

        The ID of the version.

      • OptionalmoveAffectedIssuesTo?: string

        The ID of the version to update affectedVersion to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted.

      • OptionalmoveFixIssuesTo?: string

        The ID of the version to update fixVersion to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted.

    Returns Promise<void>

    DELETE /rest/api/3/version/{id} @scopes-current manage:jira-project @scopes-beta delete:project-version:jira

  • Returns all versions in a project. The response is not paginated. Use Get project versions paginated if you want to get the versions in a project with pagination.

    This operation can be accessed anonymously.

    Permissions required: Browse Projects project permission for the project.

    Parameters

    • params: {
          expand?: string;
          projectIdOrKey: string;
      }
      • Optionalexpand?: string

        Use expand to include additional information in the response. This parameter accepts operations, which returns actions that can be performed on the version.

      • projectIdOrKey: string

        The project ID or project key (case sensitive).

    Returns Promise<Version[]>

    Returned if the request is successful.

    example:

    [
    {
    "archived": false,
    "description": "An excellent version",
    "id": "10000",
    "name": "New Version 1",
    "overdue": true,
    "projectId": 10000,
    "releaseDate": 1278385482288,
    "releaseDateSet": true,
    "released": true,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000",
    "startDateSet": false,
    "userReleaseDate": "6/Jul/2010"
    },
    {
    "archived": false,
    "description": "Minor Bugfix version",
    "id": "10010",
    "issuesStatusForFixVersion": {
    "done": 100,
    "inProgress": 20,
    "toDo": 10,
    "unmapped": 0
    },
    "name": "Next Version",
    "overdue": false,
    "projectId": 10000,
    "releaseDateSet": false,
    "released": false,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10010",
    "startDateSet": false
    }
    ]

    GET /rest/api/3/project/{projectIdOrKey}/versions @scopes-current read:jira-work @scopes-beta read:project-version:jira

  • Returns a paginated list of all versions in a project. See the Get project versions resource if you want to get a full list of versions without pagination.

    This operation can be accessed anonymously.

    Permissions required: Browse Projects project permission for the project.

    Parameters

    • params: {
          expand?: string;
          maxResults?: number;
          orderBy?:
              | "name"
              | "description"
              | "sequence"
              | "releaseDate"
              | "startDate"
              | "-description"
              | "+description"
              | "-name"
              | "+name"
              | "-releaseDate"
              | "+releaseDate"
              | "-sequence"
              | "+sequence"
              | "-startDate"
              | "+startDate";
          projectIdOrKey: string;
          query?: string;
          startAt?: number;
          status?: string;
      }
      • Optionalexpand?: string

        Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include:

        • issuesstatus Returns the number of issues in each status category for each version.
        • operations Returns actions that can be performed on the specified version.
        • driver Returns the Atlassian account ID of the version driver.
        • approvers Returns a list containing the approvers for this version.
      • OptionalmaxResults?: number

        The maximum number of items to return per page.

      • OptionalorderBy?:
            | "name"
            | "description"
            | "sequence"
            | "releaseDate"
            | "startDate"
            | "-description"
            | "+description"
            | "-name"
            | "+name"
            | "-releaseDate"
            | "+releaseDate"
            | "-sequence"
            | "+sequence"
            | "-startDate"
            | "+startDate"

        Order the results by a field:

        • description Sorts by version description.
        • name Sorts by version name.
        • releaseDate Sorts by release date, starting with the oldest date. Versions with no release date are listed last.
        • sequence Sorts by the order of appearance in the user interface.
        • startDate Sorts by start date, starting with the oldest date. Versions with no start date are listed last.
      • projectIdOrKey: string

        The project ID or project key (case sensitive).

      • Optionalquery?: string

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

      • OptionalstartAt?: number

        The index of the first item to return in a page of results (page offset).

      • Optionalstatus?: string

        A list of status values used to filter the results by version status. This parameter accepts a comma-separated list. The status values are released, unreleased, and archived.

    Returns Promise<PageBeanVersion>

    Returned if the request is successful.

    example:

    {
    "isLast": false,
    "maxResults": 2,
    "nextPage": "https://your-domain.atlassian.net/rest/api/3/project/PR/version?startAt=2&maxResults=2",
    "self": "https://your-domain.atlassian.net/rest/api/3/project/PR/version?startAt=0&maxResults=2",
    "startAt": 0,
    "total": 7,
    "values": [
    {
    "archived": false,
    "description": "An excellent version",
    "id": "10000",
    "name": "New Version 1",
    "overdue": true,
    "projectId": 10000,
    "releaseDate": "2010-07-06",
    "released": true,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000",
    "userReleaseDate": "6/Jul/2010"
    },
    {
    "archived": false,
    "description": "Minor Bugfix version",
    "id": "10010",
    "issuesStatusForFixVersion": {
    "done": 100,
    "inProgress": 20,
    "toDo": 10,
    "unmapped": 0
    },
    "name": "Next Version",
    "overdue": false,
    "projectId": 10000,
    "released": false,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10010"
    }
    ]
    }

    GET /rest/api/3/project/{projectIdOrKey}/version @scopes-current read:jira-work @scopes-beta read:project-version:jira

  • Returns related work items for the given version id.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission for the project containing the version.

    Parameters

    • params: {
          id: string;
      }
      • id: string

        The ID of the version.

    Returns Promise<VersionRelatedWork[]>

    Returned if the request is successful.

    example:

    [
    {
    "category": "Design",
    "issueId": 10001,
    "relatedWorkId": "fabcdef6-7878-1234-beaf-43211234abcd",
    "title": "Design link",
    "url": "https://www.atlassian.com"
    },
    {
    "category": "Communications",
    "relatedWorkId": "fabcdef6-7878-1234-beaf-43211234abce",
    "title": "Chat application",
    "url": "https://www.atlassian.com"
    },
    {
    "category": "External Link",
    "issueId": 10003,
    "relatedWorkId": "fabcdef6-7878-1234-beaf-43211234abcf",
    "url": "https://www.atlassian.com"
    }
    ]

    GET /rest/api/3/version/{id}/relatedwork @scopes-current read:jira-work @scopes-beta read:project-version:jira

  • Returns a project version.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission for the project containing the version.

    Parameters

    • params: {
          expand?: string;
          id: string;
      }
      • Optionalexpand?: string

        Use expand to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include:

        • operations Returns the list of operations available for this version.
        • issuesstatus Returns the count of issues in this version for each of the status categories to do, in progress, done, and unmapped. The unmapped property represents the number of issues with a status other than to do, in progress, and done.
        • driver Returns the Atlassian account ID of the version driver.
        • approvers Returns a list containing the Atlassian account IDs of approvers for this version.
      • id: string

        The ID of the version.

    Returns Promise<Version>

    Returned if the request is successful.

    example:

    {
    "archived": false,
    "description": "An excellent version",
    "id": "10000",
    "name": "New Version 1",
    "overdue": true,
    "projectId": 10000,
    "releaseDate": "2010-07-06",
    "released": true,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000",
    "userReleaseDate": "6/Jul/2010"
    }

    GET /rest/api/3/version/{id} @scopes-current read:jira-work @scopes-beta read:project-version:jira

  • Returns the following counts for a version:

    • Number of issues where the fixVersion is set to the version.
    • Number of issues where the affectedVersion is set to the version.
    • Number of issues where a version custom field is set to the version.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission for the project that contains the version.

    Parameters

    • params: {
          id: string;
      }
      • id: string

        The ID of the version.

    Returns Promise<VersionIssueCounts>

    Returned if the request is successful.

    example:

    {
    "customFieldUsage": [
    {
    "customFieldId": 10000,
    "fieldName": "Field1",
    "issueCountWithVersionInCustomField": 2
    },
    {
    "customFieldId": 10010,
    "fieldName": "Field2",
    "issueCountWithVersionInCustomField": 3
    }
    ],
    "issueCountWithCustomFieldsShowingVersion": 54,
    "issuesAffectedCount": 101,
    "issuesFixedCount": 23,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000"
    }

    GET /rest/api/3/version/{id}/relatedIssueCounts @scopes-current read:jira-work @scopes-beta read:field:jira, read:project-version:jira

  • Merges two project versions. The merge is completed by deleting the version specified in id and replacing any occurrences of its ID in fixVersion with the version ID specified in moveIssuesTo.

    Consider using Delete and replace version instead. This resource supports swapping version values in fixVersion, affectedVersion, and custom fields.

    This operation can be accessed anonymously.

    Permissions required: Administer Jira global permission or Administer Projects project permission for the project that contains the version.

    Parameters

    • params: {
          id: string;
          moveIssuesTo: string;
      }
      • id: string

        The ID of the version to delete.

      • moveIssuesTo: string

        The ID of the version to merge into.

    Returns Promise<void>

    Returned if the version is deleted.

    PUT /rest/api/3/version/{id}/mergeto/{moveIssuesTo} @scopes-current manage:jira-project @scopes-beta delete:project-version:jira, write:project-version:jira

  • Modifies the version's sequence within the project, which affects the display order of the versions in Jira.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission for the project that contains the version.

    Parameters

    • params: {
          id: string;
          versionMoveBean: VersionMoveBean;
      }
      • id: string

        The ID of the version to be moved.

      • versionMoveBean: VersionMoveBean

    Returns Promise<Version>

    Returned if the request is successful.

    example:

    {
    "archived": false,
    "description": "An excellent version",
    "id": "10000",
    "name": "New Version 1",
    "overdue": true,
    "projectId": 10000,
    "releaseDate": "2010-07-06",
    "released": true,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000",
    "userReleaseDate": "6/Jul/2010"
    }

    POST /rest/api/3/version/{id}/move @scopes-current manage:jira-project @scopes-beta write:project-version:jira, read:project-version:jira

  • Updates a project version.

    This operation can be accessed anonymously.

    Permissions required: Administer Jira global permission or Administer Projects project permission for the project that contains the version.

    Parameters

    • params: {
          id: string;
          version: Version;
      }
      • id: string

        The ID of the version.

      • version: Version

    Returns Promise<Version>

    Returned if the request is successful.

    example:

    {
    "archived": false,
    "description": "An excellent version",
    "id": "10000",
    "name": "New Version 1",
    "project": "PXA",
    "projectId": 10000,
    "releaseDate": "2010-07-06",
    "released": true,
    "self": "https://your-domain.atlassian.net/rest/api/3/version/10000",
    "userReleaseDate": "6/Jul/2010"
    }

    PUT /rest/api/3/version/{id} @scopes-current manage:jira-project @scopes-beta write:project-version:jira, read:project-version:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void