ZenHub pipeline dynamic query guide
Workspace Info Query#
Pipeline ID, Repository ID, and Issue Type ID differ per workspace.
Dynamically query based on the X-zh-workspace configured in the project root's
.mcp.json:
// Pipeline ID + Repository ID
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
// workspace.pipelines â [{ id, name }, ...]
// workspace.repositories â [{ id, name }, ...]
// Issue Type ID
const issueTypes = await mcp__zenhub__getIssueTypes();
// issueTypes â [{ id, name }, ...] (Epic, Feature, Bug, Task, Sub-task, ...)
Query Issue Type IDs via
mcp__zenhub__getIssueTypes().
Pipeline Transitions by Workflow#
Issue Processing Workflow#
New Issues â Product Backlog â Sprint Backlog â In Progress â Review/QA â [Auto Close on merge]
Note: Done pipeline is not used. Issues auto-close via GitHub
Closes #keyword on PR merge.
| Step | Trigger | Pipeline |
|---|---|---|
| Issue creation | Automatic | New Issues |
| Backlog registration | After triage | Product Backlog |
| Sprint assignment | Sprint planning | Sprint Backlog |
| Start work | On branch creation | In Progress |
| Request review | After PR creation | Review/QA |
| Complete | PR merge â GitHub auto Close |
MCP Call Examples#
// Query workspace info (once at session start)
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
const inProgress = workspace.pipelines.find(p = > p.name === " In Progress " );
const reviewQA = workspace.pipelines.find(p = > p.name === " Review/QA " );
// On work start (move to In Progress)
mcp__zenhub__moveIssueToPipeline({
issueId: " {issue.graphqlId} " ,
pipelineId: inProgress.id
})
// After PR creation (move to Review/QA)
mcp__zenhub__moveIssueToPipeline({
issueId: " {issue.graphqlId} " ,
pipelineId: reviewQA.id
})
// After PR merge: No Done pipeline move needed
// Issue auto-closes via GitHub " Closes # " keyword
GitHub Issue Creation Example#
const workspace = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
const repoId = workspace.repositories.find(r = > /* select GitHub repo */).id;
const issueTypes = await mcp__zenhub__getIssueTypes();
mcp__zenhub__createGitHubIssue({
repositoryId: repoId,
title: " feat(scope): Feature title " ,
body: " ## Summary\n...\n\n## Acceptance Criteria\n- [ ] ... " ,
issueTypeId: issueTypes.find(t = > t.name === " Feature " ).id,
labels: [ " feature " ],
})
Workspace Initialization#
To set up a new workspace with the standard pipeline structure, use the /zenhub:init-workspace
command:
/zenhub:init-workspace
Standard structure:
New Issues â Icebox â Product Backlog â Sprint Backlog â In Progress â Review/QA
If a Done pipeline exists, internal issues are Closed and manual deletion is guided.
Referencing Skills/Agents#
Files that reference this registry:
| File | Purpose |
|---|---|
commands/dev/run.md | Full workflow |
commands/dev/batch.md | Sequential issue processing |
commands/dev/issue.md | Single issue processing |
commands/agents/dev/issue-state-agent.md | Issue state management |
commands/agents/issue-processor-agent.md | Issue processing agent |
commands/zenhub/init-workspace.md | Workspace pipeline initialization |
Important Notes#
- No Hardcoded IDs: All IDs must be dynamically queried via MCP tools
-
.mcp.jsonBased: Per-project workspace is determined by theX-zh-workspaceheader in.mcp.json -
ID Query: All IDs obtained via
getWorkspacePipelinesAndRepositories()+getIssueTypes()combination