Apis related to sprints

Hierarchy

  • CommonHttpService
    • SprintService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

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

    Returns SprintService

Methods

  • Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional.

    Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call is ignored and instead the last sprint's duration is used to fill the form.

    Parameters

    Returns Promise<unknown>

    Created sprint

    example:

    {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
    "state": "future",
    "name": "sprint 1",
    "startDate": "2015-04-11T15:22:00.000+10:00",
    "endDate": "2015-04-20T01:22:00.000+10:00",
    "originBoardId": 5,
    "goal": "sprint 1 goal"
    }
  • Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to view. By default, the returned issues are ordered by rank.

    Parameters

    • params: {
          expand?: string;
          fields?: {}[];
          jql?: string;
          maxResults?: number;
          sprintId: number;
          startAt?: number;
          validateQuery?: boolean;
      }
      • Optionalexpand?: string

        A comma-separated list of the parameters to expand.

      • Optionalfields?: {}[]

        The list of fields to return for each issue. By default, all navigable and Agile fields are returned.

      • Optionaljql?: string

        Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of the returned issues. Note that username and userkey can't be used as search terms for this parameter due to privacy reasons. Use accountId instead.

      • OptionalmaxResults?: number

        The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated.

      • sprintId: number

        The ID of the sprint that contains the requested issues.

      • OptionalstartAt?: number

        The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for more details.

      • OptionalvalidateQuery?: boolean

        Specifies whether to validate the JQL query or not. Default: true.

    Returns Promise<{
        expand?: string;
        isLast?: boolean;
        issues: IssueBean[];
        maxResults: number;
        startAt: number;
        total?: number;
    } & {
        [key: string]: unknown;
    }>

    Returns the requested issues, at the specified page of the results.

    example:

    {
    "expand": "",
    "fields": {
    "flagged": true,
    "sprint": {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/13",
    "state": "future",
    "name": "sprint 2",
    "goal": "sprint 2 goal"
    },
    "closedSprints": [
    {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
    "state": "closed",
    "name": "sprint 1",
    "startDate": "2015-04-11T15:22:00.000+10:00",
    "endDate": "2015-04-20T01:22:00.000+10:00",
    "completeDate": "2015-04-20T11:04:00.000+10:00",
    "goal": "sprint 1 goal"
    }
    ],
    "description": "example bug report",
    "project": {
    "avatarUrls": {
    "16x16": "https://your-domain.atlassian.net/secure/projectavatar?size=xsmall&pid=10000",
    "24x24": "https://your-domain.atlassian.net/secure/projectavatar?size=small&pid=10000",
    "32x32": "https://your-domain.atlassian.net/secure/projectavatar?size=medium&pid=10000",
    "48x48": "https://your-domain.atlassian.net/secure/projectavatar?size=large&pid=10000"
    },
    "id": "10000",
    "insight": {
    "lastIssueUpdateTime": "2021-04-22T05:37:05.000+0000",
    "totalIssueCount": 100
    },
    "key": "EX",
    "name": "Example",
    "projectCategory": {
    "description": "First Project Category",
    "id": "10000",
    "name": "FIRST",
    "self": "https://your-domain.atlassian.net/rest/api/3/projectCategory/10000"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/project/EX",
    "simplified": false,
    "style": "classic"
    },
    "comment": [
    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "body": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper."
    }
    ]
    }
    ]
    },
    "created": "2021-01-17T12:34:00.000+0000",
    "id": "10000",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/comment/10000",
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "Administrators",
    "type": "role",
    "value": "Administrators"
    }
    }
    ],
    "epic": {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/epic/23",
    "name": "epic 1",
    "summary": "epic 1 summary",
    "color": {
    "key": "color_4"
    },
    "done": true
    },
    "worklog": [
    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "I did some work here."
    }
    ]
    }
    ]
    },
    "id": "100028",
    "issueId": "10002",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
    "started": "2021-01-17T12:34:00.000+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
    "type": "group",
    "value": "jira-developers"
    }
    }
    ],
    "updated": 1,
    "timetracking": {
    "originalEstimate": "10m",
    "originalEstimateSeconds": 600,
    "remainingEstimate": "3m",
    "remainingEstimateSeconds": 200,
    "timeSpent": "6m",
    "timeSpentSeconds": 400
    }
    },
    "id": "10001",
    "key": "HSP-1",
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/board/92/issue/10001"
    }
  • Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is required to have permissions to view the sprint.

    Parameters

    • params: {
          sprintId: string;
      }
      • sprintId: string

        the ID of the sprint from which property keys will be returned.

    Returns Promise<unknown>

    Returned if the sprint with given id exists.

    example:

    {
    "keys": [
    {
    "key": "issue.support",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/EX-2/properties/issue.support"
    }
    ]
    }
  • Returns the value of the property with a given key from the sprint identified by the provided id. The user who retrieves the property is required to have permissions to view the sprint.

    Parameters

    • params: {
          propertyKey: string;
          sprintId: string;
      }
      • propertyKey: string

        the key of the property to return.

      • sprintId: string

        the ID of the sprint from which the property will be returned.

    Returns Promise<unknown>

    Returned if the sprint exists and the property was found.

    example:

    {
    "key": "issue.support",
    "value": {
    "system.conversation.id": "b1bf38be-5e94-4b40-a3b8-9278735ee1e6",
    "system.support.time": "1m"
    }
    }
  • Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the sprint was created on, or view at least one of the issues in the sprint.

    Parameters

    • params: {
          sprintId: number;
      }
      • sprintId: number

        The ID of the requested sprint.

    Returns Promise<unknown>

    Returns the requested sprint.

    example:

    {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
    "state": "closed",
    "name": "sprint 1",
    "startDate": "2015-04-11T15:22:00.000+10:00",
    "endDate": "2015-04-20T01:22:00.000+10:00",
    "completeDate": "2015-04-20T11:04:00.000+10:00",
    "originBoardId": 5,
    "goal": "sprint 1 goal"
    }
  • Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not be updated.

    Notes:

    • For closed sprints, only the name and goal can be updated; changes to other fields will be ignored.
    • A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and have a startDate and endDate set.
    • A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' state. This sets the completeDate to the time of the request.
    • Other changes to state are not allowed.
    • The completeDate field cannot be updated manually.

    Parameters

    • params: {
          sprintBean: SprintBean;
          sprintId: number;
      }
      • sprintBean: SprintBean
      • sprintId: number

        The ID of the sprint to update.

    Returns Promise<unknown>

    Updated sprint

    example:

    {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
    "state": "closed",
    "name": "sprint 1",
    "startDate": "2015-04-11T15:22:00.000+10:00",
    "endDate": "2015-04-20T01:22:00.000+10:00",
    "completeDate": "2015-04-20T11:04:00.000+10:00",
    "originBoardId": 5,
    "goal": "sprint 1 goal"
    }
  • Sets the value of the specified sprint's property.

    You can use this resource to store a custom data against the sprint identified by the id. The user who stores the data is required to have permissions to modify the sprint.

    Parameters

    • params: {
          propertyKey: string;
          requestBody: unknown;
          sprintId: string;
      }
      • propertyKey: string

        the key of the sprint's property. The maximum length of the key is 255 bytes.

      • requestBody: unknown

        The value of the property. The value has to be a valid, non-empty JSON value. The maximum length of the property value is 32768 bytes.

      • sprintId: string

        the ID of the sprint on which the property will be set.

    Returns Promise<{
        body: unknown;
        created: boolean;
    }>

    • status: 200, mediaType: application/json

      Returned if the sprint property is successfully updated.

    • status: 201, mediaType: application/json

      Returned if the sprint property is successfully created.

  • 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.

    Notes:

    • For closed sprints, only the name and goal can be updated; changes to other fields will be ignored.
    • A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and have a startDate and endDate set.
    • A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' state. This sets the completeDate to the time of the request.
    • Other changes to state are not allowed.
    • The completeDate field cannot be updated manually.

    Parameters

    • params: {
          sprintBean: SprintBean;
          sprintId: number;
      }
      • sprintBean: SprintBean
      • sprintId: number

        the ID of the sprint to update.

    Returns Promise<unknown>

    Updated sprint

    example:

    {
    "id": 37,
    "self": "https://your-domain.atlassian.net/rest/agile/1.0/sprint/23",
    "state": "closed",
    "name": "sprint 1",
    "startDate": "2015-04-11T15:22:00.000+10:00",
    "endDate": "2015-04-20T01:22:00.000+10:00",
    "completeDate": "2015-04-20T11:04:00.000+10:00",
    "originBoardId": 5,
    "goal": "sprint 1 goal"
    }
  • Method to initialize the class. Normally used to set up validation rules.

    Returns void