Jira Cloud

This integration relies on the Atlassian Forge Webtrigger API which is currently in Beta.

Table of Contents

  • Getting started

  • Installing the Ghost Inspector plugin

  • Plugin configuration

  • Add webhook to test settings

  • Jira issues panel

  • Executing a test within Jira

  • Display custom Test ID field

  • Manual webhook customization

Getting started

Ghost Inspector provides an official plugin for Jira that will allow you to create and update issues within Jira for test executions within Ghost Inspector.

Installing the Ghost Inspector plugin

To install the plugin, go to your Jira workspace and navigate to Settings > Apps. Under Find new apps search for "Ghost Inspector":

Search for the Ghost Inspectgor app

Click on the Ghost Inspector plugin and then select Get app and then Get it now.

Install Ghost Inspector plugin for Jira

Plugin configuration

Allowing access

The Ghost Inspector plugin configuration will now be accessible under the left side of the Settings > Apps screen. Clicking on Ghost Inspector the first time will prompt you to give the app permission to your installation:

App permissions screen

Click on Allow access and then review the permissions that the Ghost Inspector plugin requires. Click Accept once you are satisfied with the permissions:

Accept the permissions

With that completed, you can now configure the plugin.

API Key configuration

With your Ghost Inspector API key, you will be able to execute tests and view test results directly within your Jira issues. Your Ghost Inspector API key can be found in your account settings.

Add your API key

Click Save to save your API key.

Configure new webhook

New issues can be created within your Jira project when your Ghost Inspector test fails. This is accomplished by using a webhook that you can configure within the Jira plugin. To create the webhook, select your project and click Configure webhook.

A new dialog will appear requiring you to complete a number of drop-downs:

Configure your Jira webhook

Here's a breakdown of the selection items:

  • Issue type - this is the type of Jira issue that will be created when your test fails.
  • Passing status - this is the status to transition your Jira issue to when a test passes.
  • Failing status - this is the status to transition your Jira issue to when a test fails.
  • Transition on - gives you the option to trigger the issue transition on test failure, screenshot failure or both.
  • Assignee - select a user that newly-created issues will be assigned to by default.

With those values selected, click Create webhook.

Add webhook to test settings

Once the webhook is created, a new URL will be provided along with a table showing the current configuration for the webhook.

New webhook created

Copy the webhook URL and navigate to your desired test. Go to Settings > Notifications > Webhooks, change the setting to Yes and click + Add webhook. Paste in the new URL and change the frequency to Always send.

Save the webhook to your Ghost Inspector test

Now click Save changes to return to your test. The next time your test is executed and fails, a new issue will be created in Jira using the webhook settings specified.

Jira issues panel

When a new issue is created in Jira from your failing Ghost Inspector test, the test ID will automatically be associated to the created issue using the custom field Ghost Inspector Test ID. The Jira issue will also be updated with the name of the user and date of completion for the original result that created the issue. A remote link will also be created that links to the most recent result:

A newly created issue in Jira

Executing a test within Jira

With the Ghost Inspector plugin installed in your Jira account, you will now see a new issue action button available on your issues. Clicking the button will open a custom panel on your issue that shows the current status of the linked Ghost Inspector test, as well as a button that will allow you to re-execute that test from within Jira:

The Ghost Inspector custom panel show test status and execution options

Display custom Test ID field

By default the custom field Ghost Inspector Test ID may not be displayed on your issue. You can add the custom field by navigating to Settings > Issues > Custom Fields and searching for "Ghost Inspector". Click the three dots (...) to the right of the field and click Associate to Screens:

Associate the custom field to issue view

Select the screens you would like to see the custom field on and click Update.

Select the views to display the custom field

The custom field Ghost Inspector Test ID will now be visible on the issue within the right panel:

Ghost Inspector Test ID is now visible on the issue

Manual webhook customization

All of the fields that are configured on your webhook can be customized either on the webhook itself as query string parameters, or within your test as variables:

Variable nameContextDescription
jiraProjectKeyCreate issueSpecifies the Jira project where new issues will be created.
jiraAssigneeCreate issueSpecifies the Jira user issues will be assiged to when the issue is created.
jiraIssueKeyUpdate issueSpecifies the Jira issue this execution will update.
jiraStatusOnPassingUpdate issueSpecifies the Jira issue status to transition to on test passing.
jiraStatusOnFailingUpdate issueSpecifies the Jira issue status to transition to on test failure.
jiraTransitionFieldCreate issue
Update issue
Specifies which field on the test will create/update a Jira issue.

Options are test, screenshot or both.

Run test w/custom settings example

Jira webhook variable customizations can be made within the Run test w/custom settings dialog:

Add variables to Run test w/ustom settings dialog

Webhook variable example

Here is an example of a webhook URL using custom parameters:

https://a1b2c3d4-abcd-9876-3546-c043ac7cfde3.hello.atlassian-dev.net/x1/iLHet6ZqoXP5OR1SMShfKuA3gx4?id=1234567&jiraProjectKey=GHOST&jiraTransitionField=screenshot