Quick overview
This workflow runs every 30 minutes to find Jira issues in a “Ready for QA” state, uses OpenAI to draft and lightly review a JSON test plan, then creates a Jira test plan issue, links it back to the requirement, and labels/comments the requirement.
How it works
- Runs every 30 minutes (or manually for a test run) and searches Jira with a configured JQL to find requirement issues ready for QA.
- Extracts each issue’s summary and description (plus any configured extra fields) and converts Jira rich text into plain text for prompting.
- Uses OpenAI to generate a structured test plan in JSON, then sends it to a second OpenAI pass to review and fix only critical problems.
- Validates the returned JSON, removes duplicate tests, enforces priority/weight ranges and the maximum test count, and renders the plan into Jira’s rich-text description format.
- If the plan is valid, creates a new Jira test plan issue, links it to the original requirement, comments on the requirement with the new issue key, and labels the requirement to prevent duplicate plans.
- If a status is configured, transitions the new test plan issue to the target Jira workflow status.
- If no valid plan can be produced, adds an “ai-needs-human” label to the requirement and comments with the failure reason without creating a test plan issue.
Setup
- Add Jira Software Cloud API credentials with permission to search issues, create issues, add comments, update labels, create issue links, and transition issues.
- Add an OpenAI API credential and ensure the configured model name in the workflow is available to your account.
- In the Config node, set your Jira base URL, JQL query, max issues per run, and the target test plan project key, issue type, link type, labels, and optional status to move the created test plan into.
- If you want to include additional requirement fields (for example acceptance criteria), add their Jira field IDs to the extraRequirementFields setting.
- For manual testing, set a specific Jira issue key in the Config node and run the workflow with the manual trigger.
Requirements
- Jira Cloud (with or without Xray)
- an OpenAI API key
- n8n 2.x with built-in nodes only
Customization
- Read acceptance criteria from a custom field with extraRequirementFields, or set statusAfterCreate to hand each plan to the next step automatically.