This resource represents plans. Use it to get, create, duplicate, update, trash and archive plans.

Hierarchy

  • CommonHttpService
    • PlansService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

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

    Returns PlansService

Methods

  • Returns a plan.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          planId: number;
          useGroupId?: boolean;
      }
      • planId: number

        The ID of the plan.

      • OptionaluseGroupId?: boolean

        Whether to return group IDs instead of group names. Group names are deprecated.

    Returns Promise<GetPlanResponse>

    Returned if the request is successful.

    example:

    {
    "crossProjectReleases": [
    {
    "name": "x-plr",
    "releaseIds": [
    345
    ]
    }
    ],
    "customFields": [
    {
    "customFieldId": 34,
    "filter": false
    },
    {
    "customFieldId": 39,
    "filter": true
    }
    ],
    "exclusionRules": {
    "issueIds": [
    1,
    2
    ],
    "issueTypeIds": [
    13,
    23
    ],
    "numberOfDaysToShowCompletedIssues": 50,
    "releaseIds": [
    14,
    24
    ],
    "workStatusCategoryIds": [
    12,
    22
    ],
    "workStatusIds": [
    11,
    21
    ]
    },
    "id": 23,
    "issueSources": [
    {
    "type": "Project",
    "value": 12
    },
    {
    "type": "Filter",
    "value": 10293
    }
    ],
    "lastSaved": "2024-10-03T10:15:30Z",
    "leadAccountId": "628f5e86d5ec1f006ne7363x2s",
    "name": "Onset TBJ Plan",
    "permissions": [
    {
    "holder": {
    "type": "AccountId",
    "value": "04jekw86d5jjje006ne7363x2s"
    },
    "type": "Edit"
    }
    ],
    "scheduling": {
    "dependencies": "Concurrent",
    "endDate": {
    "dateCustomFieldId": 1098,
    "type": "DateCustomField"
    },
    "estimation": "Hours",
    "inferredDates": "ReleaseDates",
    "startDate": {
    "type": "TargetStartDate"
    }
    },
    "status": "Active"
    }
  • Returns a paginated list of plans.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          cursor?: string;
          includeArchived?: boolean;
          includeTrashed?: boolean;
          maxResults?: number;
      } = {}
      • Optionalcursor?: string

        The cursor to start from. If not provided, the first page will be returned.

      • OptionalincludeArchived?: boolean

        Whether to include archived plans in the results.

      • OptionalincludeTrashed?: boolean

        Whether to include trashed plans in the results.

      • OptionalmaxResults?: number

        The maximum number of plans to return per page. The maximum value is 50. The default value is 50.

    Returns Promise<PageWithCursorGetPlanResponseForPage>

    Returned if the request is successful.

    example:

    {
    "cursor": "",
    "isLast": true,
    "maxResults": 2,
    "nextPageCursor": "2",
    "total": 10,
    "values": [
    {
    "id": "100",
    "issueSources": [
    {
    "type": "Project",
    "value": 10000
    }
    ],
    "name": "Plan 1",
    "status": "Active"
    },
    {
    "id": "200",
    "issueSources": [
    {
    "type": "Board",
    "value": 20000
    }
    ],
    "name": "Plan 2",
    "status": "Trashed"
    }
    ]
    }
  • Updates any of the following details of a plan using JSON Patch.

    • name

    • leadAccountId

    • scheduling

      • estimation with StoryPoints, Days or Hours as possible values

      • startDate

        • type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values
        • dateCustomFieldId
      • endDate

        • type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values
        • dateCustomFieldId
      • inferredDates with None, SprintDates or ReleaseDates as possible values

      • dependencies with Sequential or Concurrent as possible values

    • issueSources

      • type with Board, Project or Filter as possible values
      • value
    • exclusionRules

      • numberOfDaysToShowCompletedIssues
      • issueIds
      • workStatusIds
      • workStatusCategoryIds
      • issueTypeIds
      • releaseIds
    • crossProjectReleases

      • name
      • releaseIds
    • customFields

      • customFieldId
      • filter
    • permissions

      • type with View or Edit as possible values

      • holder

        • type with Group or AccountId as possible values
        • value

    Permissions required: Administer Jira global permission.

    Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find out the order of array elements.

    Parameters

    • params: {
          planId: number;
          requestBody: {
              [key: string]: unknown;
          };
          useGroupId?: boolean;
      }
      • planId: number

        The ID of the plan.

      • requestBody: {
            [key: string]: unknown;
        }
        [
        {
        "op": "replace",
        "path": "/scheduling/estimation",
        "value": "Days"
        }
        ]
        • [key: string]: unknown
      • OptionaluseGroupId?: boolean

        Whether to accept group IDs instead of group names. Group names are deprecated.

    Returns Promise<void>

    Returned if the request is successful.

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

    Returns void