This resource represents issues types. Use it to:

  • get, create, update, and delete issue types.
  • get all issue types for a user.
  • get alternative issue types.
  • set an avatar for an issue type.

Hierarchy

  • CommonHttpService
    • IssueTypesService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

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

    Returns IssueTypesService

Methods

  • Loads an avatar for the issue type.

    Specify the avatar's local file location in the body of the request. Also, include the following headers:

    • X-Atlassian-Token: no-check To prevent XSRF protection blocking the request, for more information see Special Headers.
    • Content-Type: image/image type Valid image types are JPEG, GIF, or PNG.

    For example: curl --request POST \ --user email@example.com:<api_token> \ --header 'X-Atlassian-Token: no-check' \ --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This

    The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image.

    The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size.

    After creating the avatar, use Update issue type to set it as the issue type's displayed avatar.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: string;
          mediaType: string;
          requestBody: unknown;
          size: number;
          x?: number;
          y?: number;
      }
      • id: string

        The ID of the issue type.

      • mediaType: string
      • requestBody: unknown
      • size: number

        The length of each side of the crop region.

      • Optionalx?: number

        The X coordinate of the top-left corner of the crop region.

      • Optionaly?: number

        The Y coordinate of the top-left corner of the crop region.

    Returns Promise<Avatar>

    Returned if the request is successful.

    example:

    {
    "id": "1010",
    "isDeletable": true,
    "isSelected": false,
    "isSystemAvatar": false
    }

    POST /rest/api/3/issuetype/{id}/avatar2 @scopes-current manage:jira-configuration @scopes-beta write:avatar:jira, write:issue-type:jira, read:avatar:jira

  • Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those assigned to the same workflow scheme, field configuration scheme, and screen scheme.

    This operation can be accessed anonymously.

    Permissions required: None.

    Parameters

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

        The ID of the issue type.

    Returns Promise<IssueTypeDetails[]>

    Returned if the request is successful.

    example:

    [
    {
    "avatarId": 1,
    "description": "A task that needs to be done.",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
    "id": "3",
    "name": "Task",
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
    "subtask": false
    },
    {
    "avatarId": 10002,
    "description": "A problem with the software.",
    "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
    "id": "1",
    "name": "Bug",
    "scope": {
    "project": {
    "id": "10000"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
    "subtask": false
    }
    ]

    GET /rest/api/3/issuetype/{id}/alternatives @scopes-current read:jira-work @scopes-beta read:issue-type:jira, read:project-category:jira, read:project:jira, read:avatar:jira

  • Returns all issue types.

    This operation can be accessed anonymously.

    Permissions required: Issue types are only returned as follows:

    • if the user has the Administer Jira global permission, all issue types are returned.
    • if the user has the Browse projects project permission for one or more projects, the issue types associated with the projects the user has permission to browse are returned.

    Returns Promise<IssueTypeDetails[]>

    Returned if the request is successful.

    example:

    [
    {
    "avatarId": 1,
    "description": "A task that needs to be done.",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
    "id": "3",
    "name": "Task",
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
    "subtask": false
    },
    {
    "avatarId": 10002,
    "description": "A problem with the software.",
    "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
    "id": "1",
    "name": "Bug",
    "scope": {
    "project": {
    "id": "10000"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
    "subtask": false
    }
    ]

    GET /rest/api/3/issuetype @scopes-current read:jira-work @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira, read:project:jira

  • Returns an issue type.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission in a project the issue type is associated with or Administer Jira global permission.

    Parameters

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

        The ID of the issue type.

    Returns Promise<IssueTypeDetails>

    Returned if the request is successful.

    example:

    {
    "avatarId": 1,
    "description": "A task that needs to be done.",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
    "id": "3",
    "name": "Task",
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
    "subtask": false
    }

    GET /rest/api/3/issuetype/{id} @scopes-current read:jira-work @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira, read:project:jira

  • Returns issue types for a project.

    This operation can be accessed anonymously.

    Permissions required: Browse projects project permission in the relevant project or Administer Jira global permission.

    Parameters

    • params: {
          level?: number;
          projectId: number;
      }
      • Optionallevel?: number

        The level of the issue type to filter by. Use:

        • -1 for Subtask.
        • 0 for Base.
        • 1 for Epic.
      • projectId: number

        The ID of the project.

    Returns Promise<IssueTypeDetails[]>

    Returned if the request is successful.

    example:

    [
    {
    "avatarId": 10002,
    "description": "A problem with the software.",
    "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
    "id": "1",
    "name": "Bug",
    "scope": {
    "project": {
    "id": "10000"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
    "subtask": false
    },
    {
    "avatarId": 1,
    "description": "A task that needs to be done.",
    "hierarchyLevel": 0,
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
    "id": "3",
    "name": "Task",
    "scope": {
    "project": {
    "id": "10000"
    },
    "type": "PROJECT"
    },
    "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
    "subtask": false
    }
    ]

    GET /rest/api/3/issuetype/project @scopes-current read:jira-work @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira, read:project:jira

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

    Returns void