Skip to content

Support ${issueType} in githubIssues.issueBranchTitle#8712

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/support-issue-type-template-variable
Draft

Support ${issueType} in githubIssues.issueBranchTitle#8712
Copilot wants to merge 2 commits intomainfrom
copilot/support-issue-type-template-variable

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Orgs that use GitHub issue types want to encode them in branch names (e.g. ${issueType}-${issueNumber}), but variableSubstitution did not recognize ${issueType}, so the placeholder leaked into branch names verbatim.

Changes

  • GraphQL: fetch issueType { name } on the IssueBase fragment in queries.gql and queriesExtra.gql. Skipped queriesLimited.gql since older GHES versions may not expose the field.
  • Types / parsing: thread issueType through GraphQL.Issue, the parsed Issue interface, and parseGraphQLIssue.
  • variableSubstitution: add three new cases — issueType (raw), sanitizedIssueType, and sanitizedLowercaseIssueType — mirroring the existing ${issueTitle} family. When the issue has no type, the placeholder is left as-is, consistent with ${user} when unknown.
  • Docs: extend the githubIssues.issueBranchTitle setting description in package.nls.json and the variable list in documentation/IssueFeatures.md.
  • Tests: cover each new variable plus the no-issue-type fallback in utils.test.ts.

Example

With an issue typed Production Bug Fix (#7):

// settings.json
"githubIssues.issueBranchTitle": "${sanitizedLowercaseIssueType}-${issueNumber}"
// → production-bug-fix-7

"githubIssues.issueBranchTitle": "${issueType}-${issueNumber}"
// → Production Bug Fix-7   (use sanitized variants for branch-safe output)

Copilot AI changed the title [WIP] Add support for ${issueType} template variable in branch naming Support ${issueType} in githubIssues.issueBranchTitle Apr 28, 2026
Copilot AI requested a review from alexr00 April 28, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

githubIssues.issueBranchTitle to support ${issueType} template variable name

2 participants