Skip to content

Close the linked Jira issue when a pull request merges (post-merge design and Jira status sync) #9535

Open

Description

@fullsend-ai-triage

Problem

No agent runs when a PR merges, so a Jira-sourced issue stays in whatever status the code run left it (for example In Progress) after the work is merged. Users must close it by hand. agents#2005 covers transitions at code-run start and when the PR is ready (CODE_JIRA_STARTED_TRANSITION, CODE_JIRA_PR_READY_TRANSITION) but explicitly leaves merged-PR transitions out of scope. Triage's close transitions are already shipped.

Desired behaviour

On merge of a PR that resolves a Jira key, transition the Jira issue to a configured done status, with a configured resolution where the target requires one. Requirements from the original proposal:

  • Status/transition names and resolution are config, because they vary per Jira project.
  • Optional narrowing by issue type (see the separate --if-issue-type issue) and optional branch prefixes such as agent/.
  • Idempotent: read current status and skip if already there.
  • Opt-in: nothing is installed or changed unless configured.
  • Bot-loop safe: writes by the service account must not re-dispatch agents.
  • Unknown config keys fail at repos install, not at runtime.
  • Accepted risk: an agent PR can close its own issue with no human step; that is the intent for opted-in projects and should be documented.

Open design questions (mechanism not settled)

Three approaches have been proposed in the discussion:

  1. Managed workflow + config: a pull_request_target workflow (base-branch copy, like the shim) converged by repos install like jira-poll-per-repo.yaml, driven by a tracker.jira.status_sync.pull_request.on_merged block. Concern: it assumes a particular set of agents and couples issue state to Jira connectivity.
  2. Option inside the agents (the pattern in agents#2005): not possible on its own for merge, since no agent run exists at that point.
  3. New post-merge fleet agent on the triage role, triggered on event.entity.kind == "change_proposal" && event.transition.kind == "merged", whose post-script makes the Jira transition using names from config. The same agent could serve Automatically re-triage issues when they become unblocked or their triage goes stale #9454, agents#2009 (re-triage what a merge unblocked), Post-merge workflow should close linked issues when PR targets a non-default branch #5924 (close linked issues for non-default target branch), and agents#586 (superseded PRs/issues). Retro is not a fit: it is an analyst, also runs on closed-unmerged PRs, and can be disabled.

Decisions needed:

  • Which mechanism above (ideally designed once as a general post-merge step with "close the Jira issue" as one consumer).
  • Credentials: reusable-dispatch.yml passes Jira credentials only to runs whose event source is jira; a merge event comes from the code host, so the token would need to reach the runner side only (post-script, never the sandbox). This widens where the token goes and should be an explicit decision.
  • Fail-soft (warn and continue, as with run_label) versus hard error for an explicitly configured close-on-merge.
  • Whether an ADR is needed (the original author says yes because it amends Verify Jira work items through the built-in PR lifecycle #8921's "PR stages make no Jira API calls"; another maintainer says no). Coordinate with ADR: Commit to Jira work-item tracker feature parity with native forge issues #9453 (Jira feature parity ADR).

Note: if the chosen mechanism adds a managed workflow file, the code agent cannot modify workflow files under current permissions, so that part needs a human PR or maintainer action. Config validation, resolver logic, docs, and any ADR can be done separately.

Acceptance criteria

  • With the merge hook configured, a merged PR closes its issue with the configured resolution; without it, nothing changes.
  • A failing transition warns and never blocks the merge (unless maintainers choose otherwise above).
  • Re-running logs a skip, not an error.
  • Tests: config validation, install convergence (if a workflow is used), one behaviour test for the merge path.
  • Docs: config-reference.md and the Jira guide's "what appears in Jira" table gain the merge row.

Related: #6704, #8920, #8921, #9453, agents#2005.

Activity

  1. added
    ready-for-triage
    on Nov 16, 2026
  2. fullsend-ai-triage commented on Nov 16, 2026

    @fullsend-ai-triage
    Author

    🤖 Finished Triage · ✅ Success · Started 11:07 AM UTC · Completed 11:09 AM UTC

    Commit: 4dee2f2 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.09

  3. added
    blocked
    on Nov 16, 2026
  4. fullsend-ai-triage commented on Nov 16, 2026

    @fullsend-ai-triage
    Author

    This issue is ready to move once maintainers settle the design. It isn't blocked by a missing bug report.

    What blocks implementation

    • The mechanism is undecided: a managed pull_request_target workflow with config, an option inside existing agents (which can't work alone for merges, since no agent run exists at merge time), or a general post-merge agent whose post-script makes the Jira transition. The issue suggests designing this once, since the same step could also serve Automatically re-triage issues when they become unblocked or their triage goes stale #9454, Post-merge workflow should close linked issues when PR targets a non-default branch #5924 and the superseded-PR work.
    • Credentials: Jira credentials currently reach only runs sourced from Jira. A merge event comes from the code host, so the token would need to reach the runner side only (post-script, never the sandbox). That widens where the token goes and needs an explicit decision.
    • Fail-soft (warn and continue) versus hard error for a configured close-on-merge.
    • Whether an ADR is needed, since this amends the earlier decision that PR stages make no Jira API calls.

    The Jira feature-parity ADR (#9453) is still open and should be coordinated with, as the issue already notes. Treat it as the related design decision to settle or align with first.

    Related, not blocking: #9454 and #5924 would be consumers of a general post-merge step. #6704, #8920 and #8921 are closed and are context only. The upstream agents-repo issue on Jira transitions (agents#2005) is still open and explicitly leaves merge transitions out of scope. No open PR addresses this issue.

    Workflow-file caveat: if the chosen design adds a managed workflow file, the code agent cannot modify workflow files under current permissions. That part needs a human PR or maintainer action. Config validation, resolver logic, docs and any ADR can proceed separately once the mechanism is chosen.

    Once a mechanism is chosen, this can be re-triaged as ready for implementation. The acceptance criteria in the issue are already clear.

    Blocked by:

  5. ascerra commented on Nov 16, 2026

    @ascerra
    Contributor

    The requirement I'd drop here is "Status/transition names and resolution are config, because they vary per Jira project". They do vary, but fullsend can read them from Jira when it moves the issue, so no one has to keep a copy in their repo. #9536 has the details and asks for that in fullsend issues transition.

    With it, whichever of the three mechanisms runs at merge calls fullsend issues transition --state closed, and its config shrinks to on or off. It uses the same Jira token as the move, so the credential decision is unchanged.

    The merge path needs two guards of its own, because Jira can't tell us what a merge means to a team.

    • Don't close on merge when the issue type has no in-progress status fullsend can identify. One Red Hat project uses a Bugzilla-style bug workflow (ASSIGNED, POST, MODIFIED, ON_QA, then Verified, Release Pending, Closed). A merge there means MODIFIED and not closed.
    • Leave epics and above alone, using the issue type's hierarchyLevel. A PR that names an epic's key shouldn't close the epic.

    So this stays opt-in per repo, as the issue already says.

  6. shairevivo commented on Nov 17, 2026

    @shairevivo
    Contributor

    Updates from #9536 and the #9518 thread.

    1. The "status/transition names and resolution are config" requirement is superseded. issues transition: resolve started and closed from Jira status categories, so repos keep no status names #9536 resolves started/closed from Jira's status categories at call time, so this hook should configure state: closed, with transition/status as optional escape hatches. resolution stays necessary only where the done move has no site default — AISDLC and TSTAPP qualify, since their Closed move accepts eleven resolutions and names none.
    2. That weakens option 1 (managed workflow + config). Its main justification was carrying per-project status names; issues transition: resolve started and closed from Jira status categories, so repos keep no status names #9536 removes that job.
    3. Option 3 looks right. @waynesun09 sketched a post-merge agent on the triage role triggered on event.entity.kind == "change_proposal" && event.transition.kind == "merged", and the normalized-event schema already defines merged. It also avoids the coupling @ifireball objected to.
    4. Credentials are the remaining hard part. The merge event is code-host sourced, so reusable-dispatch.yml's rule that Jira credentials go only to jira-origin runs needs an explicit widening for this one event — runner side only, post-script only, never the sandbox.
    5. ADR: one is drafted, with issues transition: resolve started and closed from Jira status categories, so repos keep no status names #9536 as a hard dependency; it amends Verify Jira work items through the built-in PR lifecycle #8921's "PR stages make no Jira API calls" for this event alone.

    Revising my proposal along these lines rather than pushing the original config block.

  7. Aliciapet11 commented on Nov 30, 2026

    @Aliciapet11
    Contributor

    @shairevivo, I’m leading work on improving how Fullsend reads Jira context and reports back, and came across this blocked issue while reviewing Jira status updates.

    Issue #9536 now has an implementation PR #9925, waiting for maintainers’ approval. Is the ADR draft you mentioned available to review? Can we progress the post-merge design and Jira credential decision in parallel, or is there anything else needed to unblock this issue?

  8. shairevivo commented on Nov 30, 2026

    @shairevivo
    Contributor

    The ADR #9518 is closed by now.
    @Aliciapet11 ^^

  9. Aliciapet11 commented on Nov 30, 2026

    @Aliciapet11
    Contributor

    /fs-triage Refresh this issue against current main and all subsequent discussion. Read Adam’s and Shai’s comments here, the discussions in #9518, and the closure rationale for #9453.

    Identify stale or superseded blockers, remaining implementation dependencies, and decisions requiring maintainer confirmation. Determine whether #9453’s closure changes the scope or blockers of this narrower close-on-merge proposal. Clarify the remaining work across fullsend and agents and whether it is ready for implementation. Do not treat issue closure as design approval or infer prioritization. Do not start implementation.

  10. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage
    Author

    🤖 Finished Triage · ✅ Success · Started 12:51 PM UTC · Completed 12:53 PM UTC

    Commit: d83d2ec · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.27

  11. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage
    Author

    Refreshed against current main (d83d2ec) and the discussion since the first triage. Nothing was implemented.

    Stale blocker removed. #9453 was closed as not planned on Nov 23, so the earlier "blocked by #9453" note no longer applies. Its closure does not change this issue's scope. The close-on-merge proposal never depended on a parity commitment, and the closure rationale (a compatibility matrix first, #9818) is not a decision about this design. Closure of an issue also isn't design approval for anything discussed in it.

    Superseded or changed requirements

    • Status, transition and resolution names as config: superseded by issues transition: resolve started and closed from Jira status categories, so repos keep no status names #9536, which resolves started/closed from Jira status categories. Config shrinks to opt-in, state: closed, optional escape hatches, and resolution only where Jira names no default.
    • Option 1 (managed pull_request_target workflow) is weakened, since its main job was carrying per-project names. Option 3 (a post-merge agent on the triage role) is favoured in the thread, but no maintainer has confirmed it.
    • Added guards from the discussion: skip when no in-progress status can be identified (Bugzilla-style workflows), and skip epics and above via hierarchyLevel.

    ADR status. #9518 is a closed issue (it was split into #9534 and #9535), not an ADR, and no ADR pull request exists for this design. The draft mentioned earlier has not been opened, so the "ADR is closed" statement appears to be a mislink. Whether an ADR is needed is still unsettled. One is proposed because the design amends #8921's "PR stages make no Jira API calls"; another maintainer said none is needed.

    Remaining dependencies

    Decisions still needing maintainer confirmation

    1. Mechanism: post-merge agent versus managed workflow.
    2. Credentials: reusable-dispatch.yml still passes Jira credentials only to Jira-sourced runs. Reaching a code-host merge event would need an explicit, post-script-only widening.
    3. Fail-soft versus hard error for a configured close-on-merge.
    4. Whether an ADR is required.

    Remaining work by repository. In this repository: the credential change, any config validation, docs (config-reference.md and the Jira guide row), behaviour tests, and the ADR if required. In the agents repository: the harness and post-script for a post-merge agent. The agents-side location was not verified. If reusable-dispatch.yml or a managed workflow is edited, the code agent cannot modify workflow files under current permissions, so that part needs a human PR or maintainer action.

    Readiness. Not ready for implementation yet. The acceptance criteria are clear, but the mechanism and credential decisions above are open, and #9925 should land first. Re-triage once those are settled.

    Blocked by:

    Blocked by:

  12. Aliciapet11 commented on Dec 3, 2026

    @Aliciapet11
    Contributor

    /fs-triage
    Reassess this issue against current main and all discussion. PR #9925 has merged, implementing #9536. Verify the landed behavior and remove these as outstanding blockers.

    Update the readiness assessment and blockers using current evidence. If maintainer decisions still prevent implementation, state the exact questions needed to unblock it. Do not treat #9925’s merge or related issue closures as approval of the post-merge design. Do not start implementation.

  13. fullsend-ai-triage commented on Dec 3, 2026

    @fullsend-ai-triage
    Author

    🤖 Finished Triage · ✅ Success · Started 2:20 PM UTC · Completed 2:22 PM UTC

    Commit: 4db7ae7 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.26

  14. fullsend-ai-triage commented on Dec 3, 2026

    @fullsend-ai-triage
    Author

    Reassessed against current main (4db7ae7) and the full discussion. Nothing was implemented.

    Blockers removed. PR #9925 is merged and #9536 is closed as completed. The code on main now resolves started/closed from Jira status categories, reports the issue type and hierarchy level, and looks up the site default resolution. That covers the config-free state handling and the epic guard this proposal depended on. #9453 (not planned) and #9518 (split into #9534 and this issue) are also no longer blockers. Neither closure, nor the merge of #9925, counts as approval of the post-merge design.

    Still not implementable. The acceptance criteria are clear, but these maintainer decisions are open. Nothing on main answers them yet: there is no status_sync or merge config and no post-merge agent, and reusable-dispatch.yml still gives Jira credentials only to Jira-sourced runs.

    1. Mechanism: a post-merge agent on the triage role (favoured in the thread, not confirmed by a maintainer), or a managed pull_request_target workflow. The managed workflow lost most of its rationale once status names stopped being config.
    2. Credentials: do maintainers accept passing the Jira token to the runner side only (post-script, never the sandbox) for the code-host merge event?
    3. Failure mode: fail-soft (warn and continue) or hard error for a configured close-on-merge?
    4. ADR: is one required, given this amends Verify Jira work items through the built-in PR lifecycle #8921's "PR stages make no Jira API calls"? No ADR PR exists. Jira status: close on merge, and gate transitions by issue type #9518 is a closed issue, not an ADR, so the earlier statement that the ADR is closed looks like a mislink.
    5. Guards: confirm skipping when no in-progress status is identifiable and skipping epics and above, opt-in per repo.

    No existing issue tracks these decisions, so a decision issue will be filed and this issue marked as blocked on it. Resolving it (or a maintainer answering the questions here) is what unblocks implementation.

    Not blockers: #9534 (--if-issue-type) is only needed for optional issue-type narrowing. #9454, #5924, agents#2009 and agents#586 would be consumers of a general post-merge step. agents#2005 (merged) covers only start and PR-ready transitions. No open PR addresses this issue.

    Remaining work by repository. This repository: credential change, config validation, docs rows, behaviour tests, ADR if required. Agents repository: harness and post-script if the agent mechanism is chosen (location not verified). If reusable-dispatch.yml or a managed workflow is edited, the code agent cannot modify workflow files under current permissions, so that part needs a human PR or maintainer action.

    Blocked by:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedready-for-triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions