Skip to Content
harness-kit

Jira

Use Jira Cloud as the tracker, over Jira's REST API with an API token, for the hand-off checks and harness-kit tracker.

You'll: give harness-kit a Jira Cloud site as its tracker, so Policies and harness-kit tracker read and change Jira issues, including sprints, ranking and custom fields. The adapter talks to Jira's REST API directly and needs no CLI.

Before you start

  • A Jira Cloud site, such as https://acme.atlassian.net.
  • An account the agent should act as, with its email address and an API token (created in Atlassian's account settings).
  • A way to set environment variables where Claude Code starts.
  • Jira is a tracker only: a configuration that names it as the forge is refused. Pair it with GitHub or an executable forge.

It answers every tracker operation, which tracker-fields and status-sync use. Issue keys in branch names, status synced sets Jira up end to end.

Connect Jira as the tracker

Export the email address and the token in the environment Claude Code starts with. The configuration names only the variables, so no secret is in a file:

export JIRA_EMAIL=agent@acme.example
export JIRA_API_TOKEN=…

Name the tracker in the configuration:

harness.config.ts
import { defineConfig } from '@microeinhundert/harness-kit';

/**
 * Jira Cloud as the tracker, signed in with an API token from the environment, and the checks that read it: issue keys
 * of the `SHOP` project linked in the final reply, and an issue in progress complete with owner, estimate and sprint.
 */
export default defineConfig({
  adapters: {
    tracker: {
      options: {
        credentials: {
          emailVariable: 'JIRA_EMAIL',
          tokenVariable: 'JIRA_API_TOKEN',
        },
        fields: {
          estimate: 'customfield_10016',
          sprint: 'customfield_10020',
        },
        site: 'https://acme.atlassian.net',
        statuses: {
          review: ['In Review', 'Code Review'],
        },
        writes: {
          cliPatterns: ['^jira issue (edit|move|assign)'],
          createPatterns: ['^jira issue create'],
          mcpTools: ['mcp__atlassian__editJiraIssue', 'mcp__atlassian__createJiraIssue'],
        },
      },
      use: 'jira',
    },
  },
  policies: [
    {
      id: 'references',
      options: {
        keyPrefixes: ['SHOP'],
      },
      use: 'references',
    },
    {
      id: 'tracker-fields',
      use: 'tracker-fields',
    },
  ],
  tracker: {
    dedupeWindowMinutes: 60,
    titleRule: {
      emojiPrefixMaxWords: 6,
    },
  },
});

Check it. harness-kit config check signs in and names the account, which proves the credentials:

npx harness-kit config check

Then try it on an issue of your own:

npx harness-kit tracker show SHOP-142 --comments
npx harness-kit tracker transition SHOP-142 review

If something goes wrong

  • Every call fails as a setup problem before any request. The variables are not set in the environment Claude Code starts with. Export them and restart the session.
  • 401 or 403. The message names the variables to check: the email and token must belong to the same account, and the account needs access to the project.
  • 404. The issue is reported as "not found".
  • 429, 5xx or an unreachable site. These are network problems. A call takes at most 30 seconds.

Troubleshooting lists more.

Options and behaviour

On this page