Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Associated with the Test Plan that we have passed along:

Xray GraphQL

Add custom steps to a manual test

In this simple scenario we are adding manual steps to a Test previously created. 

Automation Configuration

  1. create a new rule and define the "When" (i.e. when it should be triggered ), to be "Manually triggered".Image Added
  2. for this example, we have added a condition so that this automation can only be triggered by Jira issues of the type: Test.Image Added
  3. The next component to be added is a of type: "Send web request" where we will perform the authentication with the Xray API. Image Added
    1. Make sure to fill the fields with correct information:
      1. Web request URL: Authentication URL of Xray API.
      2. Headers: Add the "Content-Type" header with the value: "application/json".
      3. Define the HTTP method as POST.
      4. Choose the "Custom data" as the Web request body.
      5. Add the Json request as seen in the picture with a valid client_id and client_secret (obtained in your Jira instance).
      6.  Tick the "delay execution..." option at the bottom as we want to use the token generated in this request in the next ones.
  4. Next add another "Send web request" component to make the GraphQL request.Image Added
    1. Make sure to fill the fields with correct information:
      1. Web request URL with the endpoint of the Xray graphQL.
      2. Add two headers:
        1. "Content-Type" with "application/json".
        2. "Authorization" with "Bearer <token>". Notice that we are using a special way to get the token {{webResponse.body}} provided by Jira automation, this will get the value from the last web request made and fetch the body of the answer.
      3. Define the HTTP method as POST.
      4. Choose the Web request body to be Custom data.
      5. Fill the Custom data with a proper formatted graphQL request as seen in the picture (make sure the format is correct or the request will fail).
Usage

Once the automation is defined we can access it in the test detail view of a Test in Jira. On the right side you have an entry called "Automation".

Image Added

After clicking on it another screen will load with all the automation rules defined and the possibility to run each of them. Once you choose the correct rule and press "Run" the rule will be executed.

Image Added


The status of the execution is showed in the section "Recent rule executions".

Image Added


When the automation rule is executed with success a new test step will be added to the Test as we can see below.

Image Added

Tips

Accessing network-restricted CI/CD tools

If your target system is behind a firewall or it's a local IP address, you can use ngrok tool to create a temporary tunnel to it. Please check with your IT/security team(s).


Accessing audit log of Jira automation

If you wan to have more information about the rule execution you can click over the link presented in the "Recent rules executions".

Image Added


This will take us to the Automation rule details page where we can access the Audit log of that rule.

Image Added


This option will load all the actions performed over the rule and we can have some more details if we press the "Show more" option.

Image Added

References