Skip to main content

Creating Zenhub Issues

Unlike GitHub issues, Zenhub issues exist solely within the Zenhub application and can be used by any organization user, even if they don't have a GitHub account. Both Zenhub and GitHub issues are represented by the same Issue GraphQL type, and their type can be identified by checking the type field.

Creating a Zenhub issue follows the same process as creating a GitHub issue, using the createIssue mutation. There is no field specifically for identifying the issue type. Instead, the issue type is determined by the repository type provided in the mutation.

Zenhub issues reside in what we refer to as a "Zenhub Repository". Each workspace has a Zenhub repository, which can be accessed through the zenhubRepository field of the Workspace. To create a Zenhub issue, the Zenhub repository ID must be provided in the createIssue mutation.

Example:

Get the Zenhub repository ID of the workspace:

query zenhubRepository($workspaceId: ID!) {
  workspace(id: $workspaceId) {
    zenhubRepository {
      id
    }
  }
}

Create the Zenhub issue:

mutation createZenhubIssue($repositoryId: ID!, $title: String!, $body: String) {
  createIssue(input: { repositoryId: $repositoryId, title: $title, body: $body }) {
    issue {
      id
      title
      type
    }
  }
}