Skip to main content

Issues and PRs > State

Tom Williams avatar
Written by Tom Williams
Updated this week

Dataset: Issues & Pull Requests

Entity: Pull Requests, Issues

Field ID: state

Type: Select list

Description: The open/close state of the item. Possible values are:

  • CLOSED the issue was closed or the pull request was closed without being merged.

  • DRAFT the pull request is currently being worked on and is not ready to be looked at by others.

  • MERGED the pull request was merged.

  • OPEN the issue or pull request is still active.

Source: App

Transformation logic: N/A

From:

Github (PRs, Issues)

If isDraft = true then DRAFT.

Otherwise, it is mapped from the state field:

  • CLOSED => CLOSED

  • MERGED => MERGED

  • OPEN => OPEN

Gitlab (PRs, Issues)

If draft = true then DRAFT

Otherwise, it is mapped from the state field:

  • closed => CLOSED

  • merged => MERGED

  • opened => OPEN

Bitbucket (PRs)

Mapped from the state field:

  • DECLINED => CLOSED

  • MERGED => MERGED

  • OPEN => OPEN

  • SUPERSEDED => CLOSED

Azure DevOps (PRs, Issues)

If isDraft = true then DRAFT

Otherwise, it is mapped from the status field:

  • abandoned => CLOSED

  • active => OPEN

  • completed => MERGED

JIRA (Issues)

if resolutiondate is populated then CLOSED, otherwise OPEN.

ClickUp (Issues)

if date_closed is populated then CLOSED, otherwise OPEN.

Trello (Issues)

if closed OR dueComplete then CLOSED, otherwise OPEN.

Reporting Use Cases

The State field is the most fundamental attribute for distinguishing between active and completed work, making it essential for virtually all reporting. As a text field with a fixed set of values (OPEN, DRAFT, MERGED, CLOSED), its primary use is for filtering, but it is also powerful as a dimension and within custom formulas.

  • Filtering for Workflow State: This is the most common use case for this field. You can scope any widget to a specific phase of the lifecycle.

    • Active Work: To see all work that is still in progress, use a filter like State = "OPEN" or State equals any of "OPEN", "DRAFT". This is the basis for any "current workload" or "backlog" report.

    • Completed Work: To analyze historical performance, such as cycle time or throughput, you should filter for completed work using a filter like State equals any of "MERGED", "CLOSED".

    • Successful vs. Discarded Work: You can distinguish between work that was successfully delivered (State = "MERGED") and work that was discarded without being merged (State = "CLOSED"), which is crucial for analyzing rework or wasted effort.

  • High-Level Health Monitoring: When used as a dimension, state provides an at-a-glance overview of your projects.

    • A pie chart with State as the dimension and COUNT() as the metric will instantly show you the proportion of your work that is open, merged, or closed, providing a simple health check of your development pipeline.

  • Creating Advanced KPIs: You can use this field in COUNT_IF or SUM_IF formulas to create powerful performance metrics.

    • Merge Rate: You can calculate the percentage of completed pull requests that were successfully merged (as opposed to being closed without a merge) with a custom formula like ROUND(COUNT_IF(state == "MERGED") / COUNT_IF(state == "MERGED" OR state == "CLOSED") * 100, 2). A low rate might indicate that a lot of effort is being spent on work that is ultimately discarded.

Did this answer your question?