Contents

Jira

New to Workfile? Start with Getting started.

Each entry in providers.yml is one connection. Its name is the start of every
expression that uses it, and it is the name you give to wf setup --test.

The provider setting says which provider to use. If you leave it out, the
connection's name is used. Keep your real secrets in your environment or your
personal credentials file. Workfile refuses secrets written straight into
auth. A token can only read what its account is allowed to see.

jira:
  site: example-team.atlassian.net
  projects: [APP]
  keep_done_for: 14d
  statuses:
    todo: To Do
    doing: In Progress
    review: [In Review, Review]
    done: Done
  auth:
    email: ${EXAMPLE_JIRA_EMAIL}
    token: ${EXAMPLE_JIRA_TOKEN}

Jira Cloud#

Make a Jira API token with scopes in your
Atlassian account,
and use the email address of that account. Workfile needs permission to read Jira
work (read:jira-work) and to read who you are (read:jira-user). The second is
used by wf setup --test and by --me. If your organisation uses finer-grained scopes,
grant the matching permissions to search, to read issue change history, and to
read the current user. These guides help:
Atlassian's token guide
and REST authentication.

Setting What it means
site Required. Your Jira Cloud address, such as example-team.atlassian.net.
projects Required. The Jira project keys your team works in, such as [APP, WEB].
keep_done_for Required. How long finished tickets stay in scope, such as 14d or 2w.
skip_statuses Optional. Statuses to leave out, such as [Backlog, "On hold"].
scope Optional. Extra JQL added on top of the rest. Use it only when the settings above cannot say what you mean.
default_project Optional. A project key such as APP. It lets you name a ticket by number alone: wf status 42 means APP-42.
statuses Required. Maps each stage in your policy to one or more Jira status names. Case does not matter.
auth.email The name of the credential that holds your account email.
auth.token The name of the credential that holds your Jira API token.

Scope#

Scope says which tickets workfile reads. It is written in providers.yml, so
the file documents the team. Nothing comes from a Jira board or filter.

Workfile builds one JQL search from your settings:

You write Workfile searches
projects: [APP], keep_done_for: 14d project in ("APP") AND (statusCategory != Done OR resolved >= -14d)
projects: [APP, WEB], skip_statuses: [Backlog, "On hold"], keep_done_for: 2w project in ("APP", "WEB") AND status not in ("Backlog", "On hold") AND (statusCategory != Done OR resolved >= -2w)
Also scope: labels != spike ORDER BY rank The search above, then AND (labels != spike), ordered by rank

Why explicit? Three reasons:

  • Anyone reading providers.yml sees exactly what workfile reads.
  • A narrow search means fewer requests.
  • Changing a Jira board never changes what your policy checks.

wf status and wf tracker read the same slice. A ticket you name, such as
wf status APP-42, ignores the search, so sub-tasks and parked tickets can still
be looked up.

Every Jira status that appears in scope must map to one stage. A status that is
not mapped is reported as an error. Leave a status out with skip_statuses.

Workfile adds ORDER BY updated DESC unless your scope has its own order.
It looks up your site's cloud ID, then talks to Atlassian's gateway at
api.atlassian.com/ex/jira/<cloudId>. It uses Jira v3 search, and reads label
history in bulk when a by rule needs to know who added a label. The cloud ID
lookup needs no login. Your token is only sent to the gateway. Ticket links
point to your Jira site.

Ticket attributes#

If you renamed your Jira connection, use that name instead of jira.

Attribute What it holds
jira.summary The ticket title.
jira.description The description as plain text, with formatting removed.
jira.type The issue type, such as Story or Bug.
jira.project The project key, such as APP.
jira.assignee The assignee's display name. Empty if nobody is assigned.
jira.labels The current labels. Works with by.
jira.headings Headings in the description, plus short paragraphs written fully in bold.

Description length counts characters. Mentions and emoji count as their text
when Jira gives it. A bold-only paragraph of up to 80 characters counts as a
heading, because teams often use those as section titles.

For label rules with by, Workfile reads the label history to find who added
each current label most recently. Labels added when the ticket was created might
have no recorded person. Those labels can never satisfy a by rule. Put Jira
account IDs in people.yml, not names or emails. A person's Jira profile address
usually has their account ID after /people/.

gates:
  sign_off:
    - if: jira.labels contains accepted
      by: [alice]

Ticket images#

Jira's rich text can refer to an image by a media UUID rather than its numeric
attachment ID, sometimes without a filename. Workfile resolves these references
only when the preview asks to load an image. It inspects metadata for up to eight
candidate image attachments and caches their identities for the session.

The metadata lookup uses a HEAD request to the configured Jira connection. Its
redirect is inspected but never followed. Image bytes are then requested from
Jira with redirect=false, so credentials never reach the storage host. An image
is shown only after an exact identity match; Workfile does not guess by position
or download unrelated files. Failed lookups can be retried by refreshing the
ticket preview.

When something goes wrong#

What you see What to try
Credential is not set Make sure the ${NAME} in auth matches an environment variable or a line in your credentials file, and that it is not empty.
Credentials permission error On macOS or Linux, run chmod 600 on the file it names.
HTTP 401 Check the account, the token, and whether the token has expired.
HTTP 403 or GraphQL query rejected Check scopes, repository access, organisation rules, single sign-on, and rate limits.
Jira query rejected Try your JQL in Jira, and check the project and status names.
No Jira cloud ID Check site. Only Jira Cloud is supported.
Unmapped Jira status Add it to the right stage under statuses, or list it under skip_statuses on purpose.
A PR you expected is missing Run wf status APP-42 to search branches too. See how Workfile links PRs.
A ticket you expected is missing Check your scope, your --me or --user filter, the limit, and your account's access.

Requests time out after 30 seconds. If a request is rate limited or the gateway
has a short failure, Workfile tries again up to two times, with short waits that
you can cancel. If the wait would be longer, it tells you, so you can try later.
Responses from the providers are never printed. That keeps error messages from
repeating credentials or private data.