How to Automate Your Test Management in Jira

  August 31, 2023

With demands on software development teams to work faster than ever before, efficiency is King. Many teams are implementing test automation to boost productivity, as manual testing can be time-consuming and error prone.

Test automation revolutionizes the testing process. It enables you to automatically publish test results from various automation frameworks directly into your test management environment.

Benefits of Test Automation in Jira

Jira, one of the most popular project management platforms, doesn’t have built-in support for test automation. Teams must use a test management tool like Jira native Zephyr Squad or Zephyr Scale to track their automated test results in Jira. This integration allows you to import automation results effortlessly. The benefits of automating your tests in Jira include:

  • Increased test coverage: Test automation increases your test coverage allowing you to test more of your software. This can help you to find more defects and improve the quality of your software.
  • Reduced testing time: Automated tests run faster than manual tests. This reduces the time it takes to test your software, giving you time back to focus on other tasks.
  • Improved accuracy: Automated tests are less likely to make mistakes than manual tests. This helps ensure your software is tested thoroughly and that defects are found and fixed early.
  • Improved traceability: With test automation you can seamlessly track the execution and results of your test cases. This makes it easier to identify any defects that need to be fixed and to track the progress of your testing.

How to Use Automation in Jira Using Zephyr

Let's walk through the process of automating your test management using Zephyr in Jira. There are some differences between Zephyr Squad and Zephyr Scale, as well as your hosting type (Cloud, Server, or Data Center), so we’ve included instructions for each.

Step 1: Build and Execute the Automation

To begin the automation journey, you must build and execute the automation task. You can manually trigger the automation or utilize a continuous delivery tool to trigger the tests based on code change or something alike.

There are a few things to note when executing the tests:

  1. What is the output results format?
  2. Where are these results located?

If you use Zephyr Squad or Zephyr Scale in Jira Cloud, the automation results should be in XML format. If you use Zephyr Scale in Jira Server or Data Center, the automation results are typically in JSON.

Step 2: Publish Results to Zephyr in Jira

After executing the automation task, results will need to be sent to Zephyr to complete the automation process. Zephyr will parse the provided results file and add data to your test management system.

The execution status of the task will change from "Unexecuted" to either "In Progress," "Success," or "Fail" depending on the results file. Let’s use the Zephyr APIs for example:

Test Automation Tips

  • Use a consistent naming convention for your test cases: This makes it easier to track the execution of your test cases and generate reports on your test results.
  • Use the Test Execution feature in Jira to track the status of your test cases: This will help you ensure all your test cases are executed and the results are tracked.
  • Generate reports on your test results on a regular basis: This will help you track the progress of your testing and identify any defects that need to be fixed.
  • Integrate your test automation framework with Jira: This will allow you to automatically import test results from your test automation framework into Jira.

Conclusion

Automating your test management using Zephyr in Jira is extremely beneficial to your software development process. By integrating test automation frameworks and Zephyr, you enhance visibility, traceability, and productivity.

Manual efforts are minimized, and your team can focus on critical tasks—leading to faster development cycles and improved software quality. Embrace the power of test automation and streamline your testing process with Zephyr Scale or Zephyr Squad in Jira. Unlock your team's potential, increase efficiency, and deliver top-notch products to your customers.

Additional Resources

  1. Zephyr in Jira Automation API Templates

    There are many ways to accomplish this workflow, but here are some templates to get you started.

    Zephyr Scale on Jira Cloud
                     
    curl -H "Authorization: Bearer Zephyr-Scale-Token-Here" -F file=
    Relative-Location-of-Report-Here\report.xml;type=application/xml
    "https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey=Project-Key-Here&autoCreateTestCases=true"
                    
                    
    Shell

    Zephyr Scale on Jira Server/Data Center

                             
    curl -H "Authorization: Bearer Jira-Token-Here", "Content-Type:multipart/form-data" -F
    file=Relative-Location-of-Report-Here\report.zip
    https:///automation/execution/{projectKey}
                            
                            
    Shell

    Zephyr Squad on Jira Cloud*

                         
    curl -H "accessKey: {accessKey}" , "jwt: {jwt}" -d "jobId : {jobId}"
    https://prod-vortexapi.zephyr4jiracloud.com/api/v1/automation/job/execute
                        
                    
    Shell

    Zephyr Squad on Jira Server/Data Center*

                         
    curl -H "accessKey: {accessKey}" , "jwt: {jwt}" "Content-Type:multipart/form-data" -d “file”:”The file to
    be uploaded.” https://<clientServerBaseURL>/rest/zapi/latest/automation/upload/{automationId}
                        
                    
    Shell
  2. See a detailed Zephyr Squad CI/CD integration here.
  3. See a detailed Zephyr Scale CI/CD integration here.