Join Wintertainment 2021 to share your stories, have fun, earn community badges, and more!

ScriptRunner for Jira Integration

Applies to Zephyr Scale Server/Data Center 8.7, last modified on November 19, 2021

ScriptRunner for Jira, a collection of powerful but easy-to-use workflow functions, JQL functions, listeners, and services, enables automation of a whole range of tasks in Jira and other tools in the Atlassian ecosystem. You can use Groovy to augment the scripts ScriptRunner provides, or you can write your own. By integrating ScriptRunner with Zephyr Scale, you can automate and customise Zephyr Scale even more to better suit your specific needs and make your testing efforts more accurate and efficient.

Have a look at the ScriptRunner API options.

Note: You must have, at minimum, ScriptRunner version 5.6.8.1 installed to use the Zephyr Scale events/integration.

Zephyr Scale and ScriptRunner can currently be integrated in two ways: scripted fields and events/listeners.

Scripted fields

ScriptRunner’s custom scripted fields allow you to configure Jira issues specifically for your needs to give you a better, more comprehensive view of your testing effort.

For example, using ScriptRunner’s scripted fields, you can view automated status updates of all your Zephyr Scale items, like test cases, in Jira. No more manual updates necessary. The field values are calculated automatically by ScriptRunner and never need manual maintenance, ensuring what you see is is an accurate reflection of your test cases statuses.

Check out Creating Script Fields with ScriptRunner for Zephyr Scale Data to learn how it’s done and access example scripts.

Tip: You can also see the number of test cases linked to a Jira issue by expanding the Zephyr Scale panel while viewing a Jira issue. This integration with ScriptRunner, however, gives you another way to retrieve that information.

Zephyr Scale events

The ScriptRunner integration with Zephyr Scale Server consists of opportunities created by Zephyr Scale events. Generally speaking, an event is “fired” when something happens inside an app. In this case, when one of three Zephyr Scale events fire, an opportunity is created for Zephyr Scale and ScriptRunner to interact with each other to complete useful tasks. Even more specifically, when one of the Zephyr Scale events fire, ScriptRunner is able to hear the event (using what are called "listeners") and subsequently trigger a script to run.

There are currently three Zephyr Scale events that can integrate and communicate with ScriptRunner. These events fire when the following actions occur in Zephyr Scale:

  • A test execution is updated (TestExecutionChangedEvent)

  • A test case is updated (TestCaseChangedEvent)

  • A test cycle is updated (TestCycleChangedEvent)

This integration allows you to create scripts in ScriptRunner that run when these Zephyr Scale events fire.

Here are the ScriptRunner API options. Check out some examples of what you can use the three Zephyr Scale events and the ScriptRunner integration to accomplish.

Zephyr Scale Scenario ScriptRunner Action Zephyr Scale Event

When a test execution is updated, I want to…​

Transition any linked Jira issues/bugs to the proper status so my team knows which bugs are ready for retesting and which stories can be released

Make sure my requirements accurately reflect the latest test execution

TestExecutionChangedEvent

When a test case is updated, I want to…​

Transition any linked Jira issues to the proper status so my team knows if the requirement is covered or not

TestCaseChangedEvent

When a test cycle is completed, I want to…​

Send an email notification to the test manager, so that they can keep up-to-date with the testing progress

Transition a linked issue to another status

Update any linked Jira issues so that I can see the progress without viewing the test cycle

Ensure the progress of the cycle is traceable from the issue or Jira board

TestCycleChangedEvent

Check out Creating Listeners in ScriptRunner for Zephyr Scale Events to learn more.

Also have a look at ScriptRunner’s customer documentation about the Zephyr Scale integration.

Tip: Did you know that you can listeners in ScriptRunner to send emails and/or Slack notifications when a Zephyr Scale event occurs? For example, you can notify team members when a test case is approved, when a test cycle is completed, or when a test execution passes/fails. Sometimes it’s the small things that make a big impact.

See Also

Integrations
Creating Script Fields With ScriptRunner for Zephyr Scale Data
Creating Listeners in ScriptRunner for Zephyr Scale Events

Highlight search results