AI test cases in Jira: from a user story to a reviewed set
Get useful AI test cases from Jira user stories: the input that works, a worked example, what AI misses, a review checklist, and where to keep the cases.
AI writes good test cases from a user story when the story has acceptance criteria that say what must be true, and weak ones when all it gets is a one-line summary. Give it the criteria, tell it which kinds of cases you want, and review the draft for the things AI usually misses.
This guide shows the input that works, a worked example from one story to a set of cases, what AI tends to miss with a review checklist, where to keep test cases in Jira, and how the TestForge agent in AI Agents for Jira drafts them inside the story.
Start from a story with acceptance criteria
A model can only test what the story tells it. Before you generate anything, check that the story has:
- The behavior, in a sentence or a user story.
- Acceptance criteria, as Given/When/Then scenarios or a numbered list of rules.
- Every number and message, such as limits, amounts, and the exact text users see.
- Roles, meaning who can do this and who can’t.
- What’s out of scope, so the model doesn’t test it.
Here’s the story this guide uses:
SHOP-214 | Story | Apply a discount code at checkout
As a shopper, I want to apply a discount code at checkout,
so that I pay the promotional price.
Acceptance criteria
1. A valid, active code reduces the order subtotal by its
percentage or fixed amount.
2. One code per order.
3. Codes are not case-sensitive.
4. An expired code shows "This code has expired." and changes
nothing.
5. A code with a minimum spend shows "Spend $X or more to use
this code." when the subtotal is below X.
6. The discount never takes the subtotal below $0.00. Shipping
is never discounted.
Notes: guests and signed-in shoppers can both use codes.
Creating codes in the admin console is out of scope.
A prompt that drafts test cases
Ask for a fixed format, name the kinds of cases you want, and give the model a way to say “I don’t know”:
You are a QA engineer writing manual test cases for the Jira story
below.
Write the test cases as a table with these columns: ID, Title,
Type, Preconditions, Steps, Test data, Expected result, Criterion.
- Type is one of: Positive, Negative, Boundary, Permission,
Data state.
- Cover every acceptance criterion with at least one positive and
one negative case. Add boundary cases for every number.
- Criterion names the acceptance criterion each case checks.
- Use only behavior the story states. Where the story is silent,
don't invent the expected result: write "QUESTION:" and what the
team must decide.
- Use made-up test data only.
After the table, list any acceptance criterion with no case, and
your open questions.
Story:
[paste the story and acceptance criteria here]
If your Jira site has Rovo, Atlassian’s AI, you can run a prompt like this from the description editor too: Atlassian lists “Brainstorm edge cases to test for during QA” among its suggestions.
The worked example
Run on SHOP-214, the prompt returns a first draft like this one, shortened here to the key columns:
| ID | Title | Type | Test data | Expected result | Criterion |
|---|---|---|---|---|---|
| TC-01 | Apply a percentage code | Positive | Subtotal $80.00, SPRING20 (20% off) | Discount $16.00, subtotal $64.00 | 1 |
| TC-02 | Apply a fixed-amount code | Positive | Subtotal $80.00, TENOFF ($10 off) | Subtotal $70.00 | 1 |
| TC-03 | Enter a code in lowercase | Positive | spring20 | Same result as TC-01 | 3 |
| TC-04 | Apply a second code | Negative | SPRING20 applied, then TENOFF | QUESTION: does the second code replace the first, or is it rejected? | 2 |
| TC-05 | Apply an expired code | Negative | WINTER10, expired yesterday | “This code has expired.” No discount | 4 |
| TC-06 | Just below the minimum spend | Boundary | Subtotal $49.99, MIN50 (10% off, $50 minimum) | “Spend $50 or more to use this code.” No discount | 5 |
| TC-07 | At the minimum spend | Boundary | Subtotal $50.00, MIN50 | Discount $5.00, subtotal $45.00 | 5 |
| TC-08 | Discount larger than the subtotal | Boundary | Subtotal $20.00, TWENTYFIVE ($25 off) | Subtotal $0.00, never negative | 6 |
| TC-09 | Shipping isn’t discounted | Positive | Subtotal $80.00, shipping $5.00, SPRING20 | Discount $16.00; shipping still $5.00 | 6 |
| TC-10 | Enter an unknown code | Negative | SPRNG20 (typo) | QUESTION: which message, if any? | None |
That’s a useful draft. It doesn’t meet every rule yet: criteria 1 and 3 have only positive cases, 2 and 4 only negative ones, and nothing tests $50.01. Items 1 and 3 of the checklist below catch exactly that. Every criterion is covered, the minimum spend is tested at $49.99 and at $50.00, and the model asked two questions instead of inventing answers. Both questions are gaps in the story, not in the tests, so they go to the product owner before anyone runs a case.
Here’s what a reviewer who knows the checkout added:
- Guest and signed-in shoppers. The notes say both can use codes, and the draft tested neither on purpose. Add TC-01 as a guest and as a signed-in shopper.
- The cart changes after the code is applied. Apply MIN50 to a $60.00 cart, then remove an item so the subtotal drops to $40.00. QUESTION: is the code removed, and what does the shopper see?
- The code expires before payment. Apply a code that expires in a minute, wait, then pay. QUESTION: does the order keep the discount?
- Rounding. SPRING20 on a $33.33 subtotal gives $6.666 off. QUESTION: is that $6.66 or $6.67?
- Pasted spaces. “ SPRING20 “ copied from an email. QUESTION: are spaces trimmed?
None of these is exotic. They’re the cases that fail in production, and they all come from knowing how real shoppers behave.
What AI tends to miss
Models are good at turning each criterion into a positive and a negative case. They’re weaker wherever the story is silent:
- Boundaries beyond the obvious ones: zero, the maximum, one cent either side of a limit.
- Permissions and roles: guests, users without access, and anyone who must be refused.
- Data states: empty, expired, already used, and data that changes after the action.
- Sequences: going back, retrying after an error, submitting twice.
- Other features that touch the same data, such as tax, refunds and currency.
- Invented expectations: an exact message or number the story never gave. This is the most dangerous miss, because the case looks complete.
A review checklist for AI-drafted test cases
- Every acceptance criterion has at least one positive and one negative case.
- Every case names its criterion, or is marked as an assumption.
- Every number in the story is tested at, just below and just above its limit.
- Every role in the story is tested, including the people who must be refused.
- Data states are covered: empty, expired, used, and changed after the action.
- Expected results are specific and observable, and every message matches the story word for word.
- No expected result is invented. Open questions have gone to the product owner.
- Test data is made up, never copied from production.
- Duplicates are merged, and each case tests one thing.
Where to keep test cases in Jira
| Option | Works well for | Watch out for |
|---|---|---|
| The story’s description, or a paragraph field on the story | A handful of cases, reviewed with the story | No pass or fail per case, and no reuse |
| Subtasks of the story | A status per case, visible on the board | Hundreds of subtasks clutter boards and searches |
| A Test work type, linked to stories | Cases you reuse across releases, found with JQL | Needs a new work type, and a Jira admin to add a link type |
| A test management app | Test runs, history and coverage reports | Another tool to learn and pay for |
If you choose linked work items, a Jira admin can add a link type named Tests under Settings > Work items > Work item linking, with the outward description “tests” and the inward description “is tested by”. Then this JQL lists every case for a story:
issue in linkedIssues(SHOP-214, "is tested by")
Subtasks stop scaling once a story needs hundreds of cases, which is exactly what this Community question about handling test cases in Jira asks about. Decide early whether you need to record each run, because that’s what pushes teams to a test management app.
Generate test cases with TestForge in AI Agents for Jira
AI Agents for Jira comes with ready-made agents, and TestForge is the one that drafts test cases from the work item you’re in:
- Set it up once. A space admin adds TestForge from the app’s Agent Library tab (the docs’ path is Project > AI Agents for Jira > Agents Library) and sets its defaults on the app’s Agents tab. You can also adjust the settings for a single run from inside the work item.
- Choose what it writes. Settings cover the approximate number of cases, the work type for the cases it creates, the test type (functional, regression, smoke, security, UAT and more), the method (BDD, TDD, ATDD, specification by example, risk-based and others), whether to include test data, and an assignee.
- Check the prompt. Select Show under Prompt Preview to see TestForge’s instructions before you generate the cases.
- Run it from the story. Open the story’s AI Agent Issue Panel, run TestForge, preview and edit the cases, and create them as work items of the work type you chose. TestForge doesn’t link the new cases to the story, so if you use the JQL above, link each case to the story with your “tests” link type.
TestForge reads the parts of the story you select: summary, description and comments. Keep the acceptance criteria in the description, so they’re part of the input. When it runs, that text is sent to OpenAI to draft the cases, through the app’s trial key or your organization’s own OpenAI API key.
Common mistakes
- Generating from the summary alone. “Discount codes at checkout” gets you generic cases. The criteria are the input.
- Accepting invented messages. If the story doesn’t give the exact text, the case can’t check it. Ask, then update the story.
- Asking for as many cases as possible. Fifty cases that repeat the same path cost more to run than ten that cover the edges.
- Forgetting to regenerate. When the story changes, the cases change. Rerun the prompt and compare, or the tests drift from the story.
Questions
Can AI replace writing test cases by hand?
It replaces the blank page, not the tester. Expect a solid draft of the obvious cases; the edge cases, permissions and data states usually come from someone who knows the system.
Should test cases be subtasks in Jira?
For a few cases per story, subtasks work. For hundreds, or cases you rerun every release, use a Test work type linked to stories, or a test management app that records each run.
How many test cases should one story have?
There’s no fixed number. Aim for every acceptance criterion to have at least one positive and one negative case, plus its boundaries, and stop there.
Should AI write test cases as steps or as Given/When/Then?
Use what your team runs. Step tables suit manual testers; Given/When/Then suits teams that automate with BDD tools. Ask for one format per set, not a mix.
Keep reading
Try AI Agents for Jira
Transform ideas into actionable Jira tickets with AI-driven assistance.