# Jira Comment Pagination for Continuation Mentions

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "jira-comment-pagination-2026-07-23",
  "problems": [
    {
      "problemId": "continuation-mention-hidden-after-jsm-page-cap",
      "summary": "A valid internal ADF bot mention after the first 50 JSM comments is not discovered or answered.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29159"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29159#problem:continuation:jsm-comment-pagination"],
      "signalTextIncludesAny": ["eligibleCommentCount=0", "JSM comment page capped at 50", "continuation mention not discovered"],
      "observedThrough": "2026-07-23",
      "effectiveAt": "2026-07-23T07:58:41Z",
      "verifiedAt": "2026-07-23T08:19:57Z",
      "attemptedAction": "Honor the JSM isLastPage flag when the API caps a requested 100-comment page at 50, and continue fetching later pages before joining ADF mentions.",
      "evidenceUrl": "https://tidb.atlassian.net/rest/servicedeskapi/request/7891926/comment/23273174"
    }
  ]
}
-->

- Optimization ID: `jira-comment-pagination-2026-07-23`
- Owner: auto-oncall-services
- Source reference: `APID-29159`, internal mention comment `23263450`
- Bounded problem: continuation discovery requested 100 JSM comments, but Atlassian
  returned 50 with `isLastPage=false`; the client treated `50 < 100` as terminal
  and never fetched the page containing the valid bot mention.
- Implementation status: merged and deployed to staging.
- Effective status: `optimized_verified`.

## Verification evidence

- Live Jira platform API exposed 63 comments and the exact internal ADF mention
  in comment `23263450`.
- The JSM request-comment API returned `limit=50`, `size=50`, and
  `isLastPage=false` for the first page.
- The canonical DB had no continuation job for `23263450`; the only historical
  continuation job for this issue referenced comment `23204793`.
- Contract coverage now reproduces the 50-comment server cap and proves that a
  second-page internal ADF mention is returned with the exact bot account ID.
- Full repository regression passed on 2026-07-23: 411 tests, 0 failures.
- The staging Deployment rolled out image `636bbdf8399538bb60814532319f10c1f9b40430`
  at `2026-07-23T07:58:41Z`; live readback returned all 63 comments and exact
  internal mention `23263450`.
- After the companion backlog-starvation fix reached staging, the natural poll
  enqueued job `60187` from source comment `23263450`. Run `60104`
  (`8f41e00c-f62a-4143-89a7-a15d7f63efb7`) succeeded and wrote Jira internal
  comment `23273174`.
- Jira readback confirmed `public=false`, the current bot account as author,
  and idempotency key
  `auto-live:v1:APID-29159:continuation:23263450`.

## Unresolved gaps

- The bounded pagination problem is verified for APID-29159.

## Next validation action

Watch future Jira issues with more than 50 request comments for regressions in
later-page exact ADF mention discovery.
