User story examples by product type, each with Given/When/Then criteria

User story examples show the As a, I want, so that sentence written for a real product, with acceptance criteria that say when the story is done. Below are twelve examples in six groups: e-commerce, SaaS, website and CMS, mobile web, internal tools, and bug-fix and QA stories. Each carries a Given/When/Then scenario a tester can run, and the page ends with the checks to apply before a story enters a sprint.

  • Template
  • 7 groups
  • 7 checks
  • Updated

Most lists of user story examples stop at the sentence. As a shopper, I want to save my basket, so that I can buy later tells a team who wants what and why, and leaves out the part a developer and a tester argue about: what exactly counts as done. Every example on this page carries that part too, as a Given/When/Then scenario that a person can run by hand or a test framework can automate.

Watercolour of three wooden clothes pegs on slack string, two pale olive and the middle one burnt orange.

In the checklist

  1. E-commerce
  2. SaaS product
  3. Website and CMS
  4. Mobile web
  5. Internal tool
  6. Bug fix and QA stories
  7. Checks before a story enters a sprint 7

User story examples, ready to copy

Copy it as it is. There is no email step, and nothing on this page is behind one.

0 of 7 ticked

E-commerce

Story 1. Keep the basket across devices

As a signed-in shopper,

I want my basket to follow me from my phone to my laptop,

so that I can finish buying where it is easier to pay.

Given a signed-in shopper with two items in the basket on a phone

When they sign in on a laptop

Then the laptop basket shows the same two items, with the same sizes and quantities

And an item that has sold out since is marked unavailable, never silently removed

Story 2. Show the delivery date before payment

As a shopper choosing delivery,

I want to see the delivery date before I pay,

so that I can pick an option that arrives in time.

Given a shopper at checkout with a delivery postcode entered

When they choose Standard delivery

Then the order summary shows a delivery date, not only a number of working days

SaaS product

Story 3. Invite a teammate with a role

As a workspace admin,

I want to invite a colleague as a viewer,

so that they can read reports without being able to change them.

Given an admin on the Members page

When they invite sam@example.com with the role Viewer

Then Sam receives one invitation email

And once Sam accepts, Sam can open every report and sees no Edit button

Story 4. Warn before the seat limit

As an account owner,

I want a warning before we run out of seats,

so that nobody is blocked on the day we hire.

Given an account on a 10-seat plan with 8 seats in use

When a ninth member accepts an invitation

Then every owner receives an email saying 9 of 10 seats are used

And the Members page shows the same count

Website and CMS

Story 5. Schedule a page to publish

As a content editor,

I want to schedule a page for a set time,

so that the launch page goes live with the press release.

Given a draft page scheduled for 09:00 on 1 December, site time zone Europe/London

When that time passes

Then the page is live at its url, listed in the sitemap and found by site search

And its status in the editor changes from Scheduled to Published

Story 6. Redirect the old url when a slug changes

As a site editor,

I want the old url to redirect when I rename a page,

so that links people have already shared keep working.

Given a published page at /services/audit

When the editor changes its slug to /services/website-audit

Then /services/audit answers with a permanent redirect to /services/website-audit

And the site's own links to the page point at the new url

Mobile web

Story 7. Keep form answers when the phone rotates

As a visitor filling in the contact form on a phone,

I want my answers kept when I turn the phone,

so that I do not have to type them again.

Given a visitor halfway through the contact form with the phone upright

When they turn the phone on its side

Then every field keeps its value

And the field they were typing in stays in view with the keyboard open

Story 8. Open the number keypad for a card number

As a shopper paying on a phone,

I want the number keypad when I type my card number,

so that I do not switch keyboards in the middle of checkout.

Given the payment step in Safari on an iPhone and in Chrome on an Android phone

When the shopper taps the card number field

Then the number keypad opens

And a number typed with spaces between groups of four digits is accepted

Internal tool

Story 9. Approve several expense claims at once

As a finance approver,

I want to approve a batch of expense claims in one action,

so that month end does not take a morning of clicks.

Given an approver with 12 claims waiting

When they select 10 of them and choose Approve selected

Then the 10 claims move to Approved, each recorded with the approver's name and the time

And the 2 claims not selected stay in Waiting

Story 10. See who changed a customer's email address

As a support lead,

I want to see who changed a customer's email address and when,

so that I can answer a security query with facts.

Given a customer record whose email address an agent changed yesterday

When the lead opens the record's History tab

Then the change shows the old and the new address, the agent's name and the time

Bug fix and QA stories

Story 11. Apply a discount code once, after a refresh too

As a shopper using a discount code,

I want the discount applied once,

so that I pay the total I was shown.

Bug report: BUG-212, with steps to reproduce, browser, screenshot and console log attached.

Given a basket of 50.00 and the code SAVE10, applied once for 5.00 off

When the shopper refreshes the checkout page

Then the total stays at 45.00

And the order confirmation shows one discount line

Story 12. File a bug from the page it happens on

As a tester working on the staging site,

I want each bug report to carry the page url, the browser and a screenshot,

so that a developer can reproduce the bug without asking me.

Given a tester on a staging page with a layout fault

When they file a report from that page

Then the report holds the url, the browser and its version, the viewport size and an annotated screenshot

And the report lands in the team's tracker with the tester named as reporter

Checks before a story enters a sprint

The examples are grouped by the kind of product a web team builds: an online shop, a SaaS product, a website on a CMS, the mobile web, an internal tool, and the bug-fix and QA stories that every team writes whatever the product. Each story is small enough for one sprint, names a real role and ends in something a person can observe. Copy one, change the role and the details, and keep the shape.

This page is the gallery. The user story template in this collection is the card itself, with a field for context, out of scope, dependencies, size and who accepts the work, and one story written out in full. Use the examples here to find the right sentence and scenario, and the template to finish the story before it goes to planning.

What each group is for

Scroll the table sideways for the examples.

Group Why it earns its place Example
E-commerce Stories for an online shop, where the acceptance criteria usually turn on money, stock and delivery. The basket story shows how a Then line handles the edge case people forget, an item that sold out in between, and the delivery story shows a criterion that rules out the vague version of the feature. Then the order summary shows a delivery date, not only a number of working days
SaaS product Stories for a subscription web app, where roles, permissions and plan limits drive most of the work. Each Then names what a specific person sees or receives, which is what lets a tester check a permission story without reading the code. Given an account on a 10-seat plan with 8 seats in use
Website and CMS Stories for editors working in a content management system, where the user is a colleague and the outcome is a public page. The redirect story is the one most often missed in a site rebuild, and its criteria name the old and the new url so the check cannot be skipped. Then /services/audit answers with a permanent redirect to /services/website-audit
Mobile web Stories for visitors using a site in a phone browser, written as behaviour a tester can see on a real device. The Given line names the browsers, because a mobile web story checked only in a desktop browser's device mode has not been checked on a phone. Given the payment step in Safari on an iPhone and in Chrome on an Android phone
Internal tool Stories for back-office screens, where the user is a colleague and the value is time saved or a question answered. The criteria include what must not change, the claims left unselected, because a bulk action that touches the wrong records is the failure that matters. And the 2 claims not selected stay in Waiting
Bug fix and QA stories A defect written as a story, and a story about how bugs are reported. The fix story links its bug report and turns the report's steps to reproduce into the Given and When, so the scenario is the regression check. The reporting story is the case for capturing the url, browser and screenshot at the moment a bug is found. Bug report: BUG-212, with steps to reproduce, browser, screenshot and console log attached.
Checks before a story enters a sprint The questions to ask of any story, copied or written fresh, before it is estimated. They follow Bill Wake's INVEST checklist where it is testable in a sentence, and add the two failures the examples above are built to avoid: a scenario with several actions, and a Then nobody can observe. [ ] Each scenario has one When, and each Then is something a person or a test can observe

A user story example that cannot be tested, and the same story written so it can

Not this

As a user, I want checkout to be faster, so that it is better.

This instead

As a returning shopper paying by card,
I want my saved card offered at checkout,
so that I can pay without typing the number again.
Given a signed-in shopper with one saved card ending 4242
When they reach the payment step
Then the saved card is selected and only its security code is asked for
And a link to use a different card is shown

The first story could be accepted or rejected by anyone, because faster and better have no test. The second names who has the problem, what they will be able to do and the one action that shows it, and its Then can be checked on staging in a minute. Writing it took a decision about what faster meant, and that decision was the missing work.

How to read these user story examples

Each example has two parts. The story sentence names a role, a capability and a reason, the role-feature-benefit template that the Agile Alliance glossary dates to 2001. Under it is a scenario in the Given/When/Then style, which the same glossary dates to 2006 and which Martin Fowler credits to Daniel Terhorst-North and Chris Matts as part of behaviour-driven development. In Fowler's description, Given is the state of the world before the behaviour, When is the behaviour being specified, and Then is the change you expect as a result. And lines add to the clause above them. Keep one When per scenario: two actions in one scenario are two scenarios, and a failure in the second hides behind the first. A story can carry several scenarios, and conditions that hold in every case, such as a field limit, read better as a short list of rules than as a scenario each. The user story template in this collection has room for both.

Good and bad user story examples

A bad story is usually missing one of three things. The role is generic, as a user, so nobody can say whose problem it solves. The reason is missing or circular, so that it is better. Or the story names a solution instead of a need, add a dropdown, which is a screen element and no story at all: the Agile Alliance glossary lists screens, dialog boxes and buttons as things a user story is not. The test that catches all three is the last letter of Bill Wake's INVEST checklist, testable. Wake wrote in 2003 that a story card carries an implicit promise: I understand what I want well enough that I could write a test for it. A story such as make checkout faster breaks the promise, because nobody can say when it is done. The contrast block on this page rewrites that story into one that can be tested, with a role, one action and an observable result.

Bug fix and QA stories

Teams differ on whether a bug is a user story. Many file defects in their own queue and fix them without a story, and others write a fix as a story when it needs planning like new work. When a fix is written as a story, the bug report is its evidence. The steps to reproduce become the Given and the When, the expected result becomes the Then, and the scenario that proves the fix is also the regression check that stops the bug returning. Link the report rather than copying it, so the browser, the screenshot and the console output stay in one place. The second QA example is a story about the reporting itself. A developer who receives a report with no url, no browser and no screenshot spends the first part of the fix asking for them, and a story that makes those fields arrive with every report removes that step for every bug that follows. A visual feedback tool that files reports from the page does that capture by design.

Epic and user story examples

An epic is a body of work too large to finish in one sprint, and the stories are the slices it is delivered in. Take an epic called checkout improvements. The e-commerce stories on this page are two of its slices: the basket that follows a shopper between devices, and the delivery date shown before payment. Each can ship and be noticed on its own. Bill Wake's advice on splitting is to slice vertically, through every layer of the product, so each slice is something a customer can use; a story for the database work alone delivers nothing anyone can see. When a story here looks too big for one sprint for your team, split it by its scenarios first. The seat warning, for instance, could ship as the email alone, with the count on the Members page as a second story. The glossary entry on epics and user stories covers where the line between the two usually falls.

Turning an example into your own story

Start from the example closest to your product and change the role first, to the most specific person who has the problem: a returning shopper paying by card, never a user. Then rewrite the reason in that person's words. Replace every detail in the scenario with your own: the real page names, the real limits, the real browsers your analytics show. Keep the numbers concrete, since a Then that says 9 of 10 seats can be checked and one that says a warning appears can be argued about. Write down what the story will not do, so a reviewer does not read the gap as a bug. Then move the story to the user story template card to add its context, dependencies, size and the person who accepts it. Go through the checks at the end of the examples before the story is estimated. A team that runs a three amigos session reads the scenarios aloud there, which is where missing cases usually surface.

Common questions

What is an example of a user story?

A typical example: As a content editor, I want to schedule a page for a set time, so that the launch page goes live with the press release. Its scenario reads: Given a draft scheduled for 09:00, when that time passes, then the page is live at its url, in the sitemap and in site search.

What are the 3 Cs of a user story?

Ron Jeffries named them, as Bill Wake's INVEST article records: Card, the short written story; Conversation, the discussion that fills in the detail; and Confirmation, the tests that show the story works. The examples on this page give the card and the confirmation. The conversation still has to happen in the team.

How do you write acceptance criteria for a user story?

Write each criterion as something that is true or false of the build. For behaviour that depends on a starting state, use Given/When/Then: Given describes the state before, When the one action, and Then the result a person can observe. Martin Fowler credits the format to Daniel Terhorst-North and Chris Matts.

What makes a good user story?

Bill Wake's INVEST checklist of 2003 is the usual answer: independent, negotiable, valuable, estimable, small and testable. In practice the letter that catches most weak stories is the last one. When nobody can write a test for a story, the team does not yet know what done looks like.

Can a bug be written as a user story?

Many teams file bugs in their own queue, and some write a fix as a story when it needs planning like new work. Either way, the Given and When come from the bug report's steps to reproduce, the Then is the expected result, and the story links the report with its browser details and screenshot.

What is the difference between an epic and a user story?

An epic is work too large for one sprint, such as checkout improvements. A user story is one slice of it that a user can notice on its own, such as showing the delivery date before payment. Split epics vertically, so every story delivers something usable rather than one technical layer.

More templates

  • Watercolour of a blank paper luggage tag, its loop of burnt orange string trailing across the paper

    Template

    User story template

    A copyable user story template: the As a, I want, so that sentence, plus context, acceptance criteria, out of scope, dependencies, size and sign-off.

    8 fields, explained ·

  • Watercolour of a small brass hand bell standing upright, its wooden handle washed in burnt orange

    Template

    Release notes template

    A copyable release notes template with a filled-in example: summary, breaking changes, new, improved, fixed, known issues and where to report a problem.

    8 fields, explained ·

  • Watercolour of a small wooden box with a slot in its lid and a folded slip of paper half posted into it

    Template

    Website feedback form

    A copyable website feedback form template: the questions to ask, which two are required, optional contact details with consent, and a filled-in example.

    9 fields, explained ·

Or skip the template and capture the fields automatically.

Environment, console and network attach themselves, on the free plan.

<script src="…/widget.js" data-key="pb_pub_…">