← All recipes

GitHub Actions recipe · Pro plan

Auto-assign new tickets by category

Scitor's own routing: config in scitor.yaml can do this natively (see the routing recipe) — this is the GitHub Actions version, for teams that want the assignment logic living in a workflow file instead of scitor.yaml, or who want to combine it with other Actions steps.

What this workflow does

It fires when any category:* label is applied, looks the label up in a small map, and adds the matching GitHub username(s) as assignees.

What it does not do

It requires AI triage (Pro plan) to be enabled — category labels don't exist on Free. It only assigns; it doesn't notify anyone beyond GitHub's own assignment notification. The username map in the workflow is a placeholder — edit it to match your team and the category labels Scitor actually applies in your repo.

The workflow file

Save as .github/workflows/auto-assign-by-category.yml.

# Auto-assign new tickets by category
#
# Scitor's AI triage (Pro plan) labels every ticket with a category —
# bug-report, billing, account, feature-request, and so on. This assigns
# a GitHub user or team the moment that label lands.
#
# What this does:
#   - Fires when a `category:*` label is applied.
#   - Looks up the label in a small assignment map and adds the matching
#     GitHub username(s) as assignees.
#
# What this does NOT do:
#   - It only adds an assignee — it does not notify them anywhere but
#     GitHub's own assignment notification. Combine with the Slack or
#     PagerDuty integration if you want a chat/page alert too.
#   - It does not reassign on relabeling: removing and reapplying the same
#     category label re-adds the same assignee (harmless, since GitHub
#     assignment is idempotent), but if you change the mapping below, past
#     tickets keep their original assignee until manually reassigned.
#   - The assignment map below is a starting point — edit the usernames
#     and categories to match your own team and Scitor's actual category
#     labels for your repo (check .github/scitor.yaml or the labels Scitor
#     has already applied to see what's in use).
#
# No secrets required — uses the workflow's default GITHUB_TOKEN.
#
# Source: adapted from Scitor's own documented example at
# https://support.scitor.io/guides/github-actions#auto-assign-based-on-category

name: Auto-assign by category
on:
  issues:
    types: [labeled]

jobs:
  assign:
    if: >
      startsWith(github.event.label.name, 'category:') &&
      github.event.issue.user.login == 'scitor-customerops[bot]'
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            const assignments = {
              'category:bug-report': ['dev-team-lead'],
              'category:billing': ['billing-team'],
              'category:account': ['account-manager'],
              'category:feature-request': ['product-manager'],
            };

            const assignees = assignments[context.payload.label.name];
            if (assignees) {
              await github.rest.issues.addAssignees({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: context.issue.number,
                assignees,
              });
            }

No secrets required — uses the workflow's default token.

Route tickets without lifting a finger

Takes under 5 minutes. Free tier available. No credit card required.