Versions Compared

Key

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

...

Xray for Jenkins is configured in the global settings configuration page  Manage Jenkins > Configure System > Xray for Jira configuration.

Jira

...

Instance

The Jira servers configuration defines connections with Jira instances. 

...

  1. Configuration alias
  2. Hosting: Hosting (instance type) in this case Server/Data Center.
  3. Server Address: The address of the Jira Server where Xray is running
  4. Credentials:
    1. Use the Jenkins Credentials Plugin to set the API key/secret
    2. Make sure that was used to create the API key has the following permissions in the projects where you want to import the results and import/export feature files: View, Edit, Create.
    3. This field is optional - if you don't want to use a System scoped credential to authenticate in your instance, you can leave this field empty and force the users to use an User scoped credential in the build task.


Notenote: the Configuration ID is not editable. This value can be used in the pipelines scripts.

Info
titlePlease note

The user present in this configuration must exist in the JIRA Jira instance and have permission to Create Test and Test Execution Issues in the target project

...

fielddescription
Jira instanceThe Jira instance where Xray is running
CredentialsIf the above Jira Instance does not have any credential configured, you must define an User scoped credential here
Issue keysSet of issue keys separated by ";"

Filter ID

A number that indicates the filter ID
File path

The relative path of the directory where the features should be exported to; normally, this corresponds to the "features" folder of the Cucumber project that has the implementation steps. Note: The directory will be created if it does not exist.

...

It invokes Xray's Import Cumcumber Tests REST API endpoint (see more information here)

fielddecription
JIRA Jira instanceThe Jira instance where Xray is running.
CredentialsIf the above Jira Instance does not have any credential configured, you must define an User scoped credential here
Project KeyThis is the project where the Tests and Pre-Conditions will be created/updated.
Cucumber feature files directoryThis is the directory containing your feature files. All the files in this directory and sub directories will be imported. Supports both relative and absolute paths.
Modified in the last hoursBy entering an integer n here, only files that where modified in the last n hours will be imported. 
Leave empty if you do not want to use this parameter.

...

fielddescription
Jira instanceThe Jira instance where Xray is running
CredentialsIf the above Jira Instance does not have any credential configured, you must define an User scoped credential here
FormatA list of test result formats and its specific endpoint
Execution Report File

The results relative or absolute file path.

Note: glob expressions are supported for

  • JUnit
  • JUnit Multipart
  • TestNG
  • TestNG Multipart
  • NUnit
  • NUnit Multipart
  • XUnit
  • XUnit Multipart
  • Robot framework
  • Robot framework Multipart

...

format and specific endpointfielddescription

Cucumber JSON multipart

NUnit XML multipart

JUnit XML multipart

XUnit XML multipart

Robot XML multipart

TestNG XML multipart

Import to Same Test ExecutionWhen this option is check, if you are importing multiple execution report files using a glob expression, the results will be imported to the same Test Execution

Test execution fields

An object (JSON) specifying the fields for the issue. You may specify the object either directly in the field or in the file path.


Info
titleLearn more

The custom field IDs can be obtained using the Jira REST API Browser tool included in Jira. Each ID is of the form "customfield_ID".

Another option, which does not require Jira administration rights, is to invoke the "Get edit issue meta" in an existing issue (e.g., in a Test issue) as mentioned here.

Example: GET https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/editmeta

Warning
titleTest Fields

Please notice that currently only the Test Execution Fields are supported. If you need to use the Test Field you may need to make a direct call (e.g. using CURL) to our REST API.

Import in parallelIf there are several result files, when this checkbox is selected, we will import all the files in parallel (using all available CPU cores)


NUnit XML

JUnit XML

XUnit XML

Robot XML

TestNG XML

Import to Same Test ExecutionWhen this option is check, if you are importing multiple execution report files using a glob expression, the results will be imported to the same Test Execution
Project keyKey of the project where the Test Execution (if the Test Execution Key field wasn't provided) and the Tests (if they aren't created yet) are going to be created
Test execution key

Key of the Test Execution

Test plan keyKey of the Test Plan
Test environmentsList of Test Environments separated by ";"
RevisionSource code's revision being target by the Test Execution
Fix versionThe Fix Version associated with the test execution (it supports only one value)
Import in parallelIf there are several result files, when this checkbox is selected, we will import all the files in parallel (using all available CPU cores)

Xray: Build

...

Environment Variables

Since version 2.2.0, the Xray plugin will now set some build enviroment environment variables according to the operation result after each of the Xray Steps mensioned mentioned above.


Build Enviroment Variable NameMeaning and Value

XRAY_IS_REQUEST_SUCCESSFUL

Contains the string 'true' if all requests made by the step were sucessefulsuccessful, or 'false' otherwise.

XRAY_ISSUES_MODIFIED

All Issue keys that were modified and/or created by the step, seperated separated by ';' with no duplicated entries (E.g. 'CALC-100;CALC-101;CALC-102').

XRAY_RAW_RESPONSE

The unprocessed JSON response of all requests made by the step, seperated separated by ';'.

XRAY_TEST_EXECS

All Test Execution Issue keys that were modified and/or created by the step, seperated separated by ';' with no duplicated entries (E.g. 'CALC-200;CALC-201;CALC-202').

Please note that in same cases, it will be not possible to determine the issue type of the Issue key returned in the request response and in that case, the key it will only be added to the XRAY_ISSUES_MODIFIED variable.

XRAY_TEST

All Test Issue keys that were modified and/or created by the step, seperated separated by ';' with no duplicated entries (E.g. 'CALC-300;CALC-301;CALC-302').

Please note that in same cases, it will be not possible to determine the issue type of the Issue key returned in the request response and in that case, the key it will only be added to the XRAY_ISSUES_MODIFIED variable.

...