← All posts

How to generate test cases from Jira user stories (with AI)

· 4 min read

To generate test cases from a Jira user story, make sure the story has clear acceptance criteria, turn each criterion into a testable requirement, then generate positive, negative, boundary and integration cases for it and link each case back to the story. AI can do most of the generation. The quality of what it generates depends almost entirely on the quality of the story.

Step 1: Check the story is ready to test

A story is ready to generate tests from when it passes this checklist:

  • The user and the goal are clear ("As a shopper, I want to apply a coupon so that I pay less").
  • Acceptance criteria exist and each describes observable behaviour.
  • Rules have values: limits, formats, messages ("minimum cart value $50", not "a minimum").
  • Error behaviour is described, not only the happy path.
  • Out-of-scope items are stated so nobody tests what isn't built.
  • Linked designs or specs are attached if the criteria refer to them.

If a box is empty, fix the story first. Generating tests from a vague story produces confident tests of guessed behaviour.

Step 2: Write acceptance criteria as Given / When / Then

Given/When/Then maps almost one-to-one onto a test case:

Story: As a shopper, I want to apply a coupon at checkout so that I pay less.

AC1  Given a cart of $60.00
     When I apply the valid code SAVE20
     Then the total shows $48.00

AC2  Given a cart of $60.00
     When I apply the expired code WINTER25
     Then I see "This coupon has expired" and the total stays $60.00

AC3  Given a cart of $49.99
     When I apply MIN50 (minimum cart value $50)
     Then I see the minimum-value message and no discount is applied
  • Given becomes the preconditions.
  • When becomes the steps.
  • Then becomes the expected result.

Step 3: Expand each criterion into categories

Acceptance criteria describe the examples the team agreed on. They rarely cover every edge. For each criterion, ask the generator for:

  • Positive variations (other valid codes, other cart sizes).
  • Negative cases (unknown code, empty field, extra spaces, wrong case).
  • Boundary cases ($49.99, $50.00, $50.01; a code that expires today).
  • Integration cases (discount survives a cart update; the order confirmation shows the discount).

The category guide lists more ideas for each.

Step 4: Use a prompt that prevents guessing

You are a senior QA engineer. Generate test cases for the Jira story below.
For each acceptance criterion, write positive, negative, boundary and integration cases where they apply.
Output a table: ID, title, story key, acceptance criterion, category, preconditions, steps, test data, expected result.
Rules: only use behaviour stated in the story; list anything unclear as an open question; use exact values;
one expected result per case.
Story: <paste the story key, description and acceptance criteria>

Step 5: Review, then link

Review the generated cases against the story. Remove duplicates, correct expected results and answer the open questions with the product owner. Then store the story key (for example SHOP-142) on every test case. That link lets you trace failures back to the story and see which stories have no tests, which is what a traceability matrix is for.

Where AI helps, and where it does not

AI is good at AI needs a human for
Listing edge cases systematically Deciding what the right behaviour is
Covering every category consistently Spotting that a criterion contradicts another story
Drafting steps and test data quickly Judging business risk and priority
Keeping the format consistent Knowing what changed outside the story

Doing it without copy-paste

Copying stories into a chat window works for one story. It breaks down across a backlog: the AI has no memory of other stories, links get lost, and results never flow back to Jira.

In testdart, Project Brain takes your Jira issues along with specs, PRDs and user stories, and extracts the requirements. AI Genie generates test cases for the requirements you pick, across the categories you choose. In copilot mode your team reviews them before they run in a real Chrome browser, and every result stays linked to the requirement it came from. It's the loop we describe in what is AI-native QA. Start free with one project.

FAQ

Should test cases live in Jira or in a test management tool? Wherever your team will keep them linked to stories and results. The link matters more than the location.

What if a story has no acceptance criteria? Write them before generating tests. The test cases can only be as good as the criteria.

Can I generate tests from an epic? Generate from stories. Epics are usually too broad to produce precise expected results.

See it on your own flow.

testdart reads your requirements, writes the test cases, runs them in a real browser and shows you what broke.