# Match Jira comment attachments with truncated timestamps

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "comment-attachment-timestamp-precision-2026-07-21",
  "problems": [
    {
      "problemId": "same-second-comment-attachment-mapping-fails",
      "summary": "A Jira comment timestamp without milliseconds cannot map its attachment timestamp from the same second.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29203"],
      "sourceRefs": [],
      "signalTextIncludesAny": ["attachment_mapping_unresolved", "live_attachment_input_failed"],
      "observedThrough": "2026-07-21",
      "effectiveAt": "2026-07-21T06:58:00Z",
      "verifiedAt": "2026-07-21T06:59:35Z",
      "attemptedAction": "Allow a Jira attachment to match its source comment only when it is created within the same timestamp second lost by JSM serialization.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/417"
    }
  ]
}
-->

- Optimization ID: `comment-attachment-timestamp-precision-2026-07-21`
- Title: Match Jira comment attachments with truncated timestamps
- Owner: auto-oncall-services
- Source type: staging rerun failure
- Source reference: `APID-29203`, failed run DB `60041`, verified run DB `60044`

## Bounded problem

JSM returned the source comment timestamp at second precision while Jira's
issue attachment field retained milliseconds. The attachment was created 158
milliseconds into that same second, so the strict `attachment <= comment`
comparison left the visible log unmapped and failed live preflight.

## Status

- Implementation: complete in `tidbcloud/aisupport#417`.
- Effective/deployment: staging image containing merge commit `b6f1e0e`.

## Problem validation

| Problem signal | Ticket keys | Status | Evidence |
| --- | --- | --- | --- |
| Same-second comment attachment is rejected as `attachment_mapping_unresolved` | `APID-29203` | `optimized_verified` | Post-change run DB `60044` materialized `20260721.log` as available, succeeded, and wrote Jira internal comment `23247770` with `public=false` on 2026-07-21. |

## Unresolved gaps and next action

- No unresolved gap for this timestamp-precision problem. Continue routine
  monitoring for attachment failures with different causes.
