Bug report template: what to include, with a filled-in example

A markdown template with the nine sections an engineer needs to reproduce a bug without follow-up questions, a complete example report, the equivalent GitHub issue form, and how to share the report as a link with someone who has no tracker access.

Updated

What should a bug report contain?

Nine sections. The first four get the bug reproduced; the rest get it prioritised and fixed without a round trip back to the reporter.

SectionAnswersMost common omission
TitleWhat breaks, where, under what conditionThe condition
SummaryWho is affected and why it mattersImpact
EnvironmentVersion or build, URL, OS/browser, account typeThe build number
Steps to reproduceExact numbered actions from a known starting stateThe starting state
Expected resultWhat should have happenedLeft implicit
Actual resultWhat happened, with exact error textParaphrased errors
EvidenceScreenshot, request/response, log linesThe response body
ScopeHow often, which versions, how many reportsThe last version that worked
WorkaroundWhat users can do today"None" is a valid answer

Bug report template (markdown)

Copy this into your tracker, wiki, or a new document. Every section is an H2 so the rendered report gets a table of contents.

# Bug: <one line — what breaks, where, under what condition>

## Summary
Two or three sentences: what happens, who it affects, why it matters.

## Environment
- Product / version / build (commit if known):
- URL or screen:
- OS + browser or device:
- Account type / role / region:

## Steps to reproduce
1. ...
2. ...
3. ...

## Expected result
What should have happened.

## Actual result
What happened instead. Quote exact error text.

## Evidence
- Screenshot / recording:
- Request + response (status, body):
- Console or server log lines:

## Scope and impact
- Reproduces N/N times on <env>; not on <env/version>.
- Who is affected; how many reports so far.

## Workaround
What a user can do right now, or "none".

## Suspected cause (optional)
Only if you have a concrete lead — a PR, a commit, a config change.

What does a good bug report look like filled in?

A fictional but realistic one: a checkout page loses an applied discount when the quantity changes. Notice what makes it actionable — the build number, the SKU and promo code used, the request that returned the wrong body, the last build that worked, and the number of support tickets that match.

bug-report.md

2,718 characters · fictional example, same file as the download

Bug: checkout total drops the applied discount after changing item quantity

Summary

On the checkout page, changing a line-item quantity after a promo code has been applied recomputes the subtotal but silently removes the discount. The promo code still shows as "applied", so customers are overcharged without warning.

Environment

  • Product: acme/shop-web, production, build 2026.09.04-1 (commit c81d2f7)
  • URL: https://shop.acme.example/checkout
  • Browser: Chrome 140.0 on macOS 15.6; also reproduced on Safari 18.5 (iPhone 15)
  • Account: any logged-in customer; also reproduces as a guest
  • Region / currency: US, USD

Steps to reproduce

  1. Add "Trail Runner 2" (SKU TR2-BLK-42) to the cart, quantity 1.
  2. Open /checkout and apply promo code SAVE10 (10 % off, active until 2026-12-31).
  3. Confirm the total shows the discount line: Subtotal $120.00 · Discount −$12.00 · Total $108.00.
  4. Change the quantity of "Trail Runner 2" from 1 to 2 using the quantity stepper.

Expected result

Subtotal updates to $240.00, discount updates to −$24.00, total $216.00. Promo badge stays "SAVE10 applied".

Actual result

Subtotal updates to $240.00, the discount line disappears, total shows $240.00. The promo badge still reads "SAVE10 applied". Placing the order charges $240.00 (verified on a test card; order #A1-73921).

Evidence

  • Screen recording: checkout-discount-drop.mp4 (14 s, attached to the ticket)
  • Network: PATCH /api/cart/lines/ln_8f21 → 200; response body has "discounts": [] while the request before the change returned "discounts": [{"code":"SAVE10","amount":1200}]
  • Console: no errors
  • Order in admin: #A1-73921, discount field empty, promo usage counter for SAVE10 was incremented

Scope and impact

  • Reproduces 5/5 on production and 5/5 on staging (2026.09.04-1).
  • Does not reproduce on the previous build 2026.08.28-2 (staging rollback).
  • Only quantity changes trigger it; removing a line or adding a new product keeps the discount.
  • Support has 11 tickets since 2026-09-04 matching "discount disappeared" — likely the same bug.

Workaround

Remove and re-apply the promo code after changing quantities. The discount then recomputes correctly. Support is telling customers this in the meantime.

Suspected cause (optional)

The quantity endpoint was changed in 2026.09.04-1 ("cart: recompute line totals server-side", PR #4127). The new handler builds the cart response from lines only and never re-reads cart.discounts; the promo badge is rendered from client state, which is why it still looks applied.

Attachments

  • checkout-discount-drop.mp4
  • har-checkout-quantity-change.har (cookies stripped)

How do I turn the template into a GitHub issue form?

For a public repository, the same sections as a YAML issue form in .github/ISSUE_TEMPLATE/bug_report.yml. Required fields stop reporters from skipping the steps or the version; the free-text fields keep the markdown habits (numbered steps, fenced error text) intact.

# .github/ISSUE_TEMPLATE/bug_report.yml
name: Bug report
description: Something is broken
title: "Bug: "
labels: [bug, triage]
body:
  - type: textarea
    id: summary
    attributes: { label: Summary, description: What happens, who it affects, why it matters }
    validations: { required: true }
  - type: input
    id: version
    attributes: { label: Version / build, placeholder: "2026.09.04-1 (c81d2f7)" }
    validations: { required: true }
  - type: input
    id: env
    attributes: { label: Environment, placeholder: "Chrome 140 · macOS 15.6 · US" }
  - type: textarea
    id: steps
    attributes:
      label: Steps to reproduce
      value: |
        1.
        2.
        3.
    validations: { required: true }
  - type: textarea
    id: expected
    attributes: { label: Expected result }
    validations: { required: true }
  - type: textarea
    id: actual
    attributes: { label: Actual result, description: Quote exact error text }
    validations: { required: true }
  - type: textarea
    id: evidence
    attributes: { label: Evidence, description: Screenshots, request/response, logs }
  - type: textarea
    id: workaround
    attributes: { label: Workaround }

GitLab and Gitea use markdown description templates instead (.gitlab/issue_templates/Bug.md, .gitea/ISSUE_TEMPLATE/bug.md) — paste the markdown template above into those files as-is.

How do I share a bug report with someone who has no tracker access?

A customer, a vendor, a contractor, a release thread in Slack: paste the markdown on the Docs MD editor and share the link. From Claude Code or Cursor with the MCP server connected:

Write a bug report for the failing checkout test using the nine-section
template (build, steps, expected, actual, evidence, scope, workaround), then
share it with a 7-day expiry and give me the reading link.

From a shell or CI:

curl -s -X POST https://docs-md.com/api/share \
  -H "Content-Type: application/json" \
  --data-binary @<(jq -Rs '{content: ., filename: "bug-report.md", expiry: "7d"}' bug-report.md) \
  | jq -r '.url'

The reader opens a rendered page with headings and a sidebar table of contents. The /raw/<id> URL returns the markdown itself for pasting into a ticket or feeding to an assistant.

What should stay out of a bug report?

  • Several bugs in one report. One report, one bug, one title.
  • Guesses written as facts. Put leads under "Suspected cause" and say why.
  • Screenshots without the step they belong to.
  • Secrets and personal data: session cookies, API keys, customer names. Strip cookies from HAR files. A shared link is public to anyone who has it.

See also: agent handoff document, share an implementation plan and the REST API.

FAQ

What should a bug report contain?

A one-line title, a short summary, the environment (version or build, URL, OS and browser, account type), numbered steps to reproduce, the expected result, the actual result with exact error text, evidence (screenshot, request and response, logs), the scope (how often it reproduces and on which versions), and a workaround if one exists. A suspected cause is optional.

How do I write a bug report in markdown?

Use one H2 per section so the report has a table of contents, numbered lists for steps, a fenced code block for error text and log lines, and a table if you compare versions or environments. Keep the title under 80 characters and start it with "Bug:". The template on this page is plain markdown you can paste into GitHub, GitLab, Jira, Linear, or a shared document.

What is the difference between a bug report template and a GitHub issue form?

A markdown template is a document with headings that the reporter fills in anywhere. A GitHub issue form is a YAML file in .github/ISSUE_TEMPLATE that renders as a web form with required fields, so reporters cannot skip the steps or the version. Both produce the same sections; use the form for public repositories and the markdown template everywhere else.

How detailed should the steps to reproduce be?

Detailed enough that someone who has never seen the product can follow them without asking a question: exact menu names, exact input values, the SKU or record id, and the starting state. If a step depends on data, say which data. Five precise steps beat one vague paragraph.

How do I share a bug report with someone outside the issue tracker?

Paste the markdown into Docs MD and share the link. The reader gets a rendered page with headings and a table of contents; nobody needs an account or tracker access. Choose a 7-day expiry for a report that will be copied into a ticket, or "never" for a report you link from a postmortem. Keep credentials and customer data out of it — the link is public to anyone who has it.

What should I leave out of a bug report?

Guesses presented as facts, several bugs in one report, screenshots without the step they belong to, and anything private: session cookies, API keys, customer names. Strip cookies from HAR files before attaching them.