Jira
Import user stories from Jira into TestDriver test files.
Importing user stories from Jira into TestDriver test files
This guide explains how to extract user stories from Jira and convert them into TestDriver test files. By automating this process, you can ensure that your user stories are directly translated into actionable test cases for TestDriver.
Workflow overview
- Export User Stories from Jira: Use the Jira API to fetch user stories.
- Convert User Stories to TestDriver YAML: Transform the user stories into YAML test files.
- Save and Organize Test Files: Store the generated YAML files in a structured directory.
- Run Tests with TestDriver: Execute the tests using the TestDriver CLI.
Step 1: Export user stories from Jira
Prerequisites
- Jira API Token: Generate an API token from your Jira account.
- Jira Base URL: Your Jira instance URL (for example,
https://yourcompany.atlassian.net
). - Node.js: Ensure Node.js is installed on your system.
Script: Export user stories from Jira
The following script fetches Jira tickets and extracts the user story title and acceptance criteria.
Install dependencies:
Node.js script (export-jira-user-stories.js
):
Step 2: Convert user stories to TestDriver YAML
The script above generates a YAML file for each Jira ticket. Each file contains the acceptance criteria as prompt
entries.
Example YAML file (testdriver_tests/PROJ-123.yaml
):
Step 3: Save and organize test files
- The generated YAML files will be saved in the
testdriver_tests/
directory. - Ensure the directory is part of your TestDriver project structure.
Step 4: Run tests with TestDriver
Use the TestDriver CLI to execute the generated test files.
Run a single test file:
Run all test files:
Best practices
- Field Mapping: Ensure the correct Jira field ID (for example,
customfield_12345
) is used for “Acceptance Criteria.” - Secure Credentials: Store Jira API credentials in environment variables or secrets.
- Review Generated Files: Manually review the YAML files to ensure they align with your testing requirements.
- Organize Tests: Use a structured directory (for example,
testdriver_tests/
) to manage your test files.
Summary
By following this guide, you can automate the process of importing user stories from Jira into TestDriver test files. This ensures that your acceptance criteria are directly translated into actionable tests, streamlining your testing workflows and improving coverage.