XRAY Test Run custom fields

Dear all,
is it possible to import values of XRAY internal custom fields, aka Test Run Custom fields. Those can be added to a Test Run (internal XRAY Type)? We use those fields to record times for preparation and execution PLUS the PC on which the test was executed.

Thank you for your support,

Stefan

Hi @sklaffke,

Test run custom fields are at the individual test run level. The test run is the most detailed level for Xray data analyses in eazyBI. Still, there is no separate dimension to which you could import additional information on each Test Run.

If the test runs custom field is a numerical field, like duration or count, you can import it using additional data import with SQL select to the Jira database or REST API.
In your case, this might work quite well for numeric custom fields “Logged time for test preparation” and “Logged time for test execution,” but for an “Assigned PC,” it won’t be a convenient solution.

For example, if you have a test run custom fields “Logged time for test preparation” and “Logged time for test execution”, the SQL select or REST API should return the following data (columns):

  • test execution issue key, use this column for data mapping to dimension Xray Test Execution, level Test Execution. Select advanced options “Key column” and “Skip missing”.
  • test issue key, use this column for data mapping to dimension Xray Test, level Test. Select advanced options “Key column” and “Skip missing”.
  • custom field “Logged time for test preparation” value. Import it as a new Measure.
  • custom field “Logged time for test execution” value, Import it as a new Measure.

The data mapping screen might look like in the picture below:

There is more on the additional data import and data mapping: https://docs.eazybi.com/eazybijira/data-import/jira-issues-import/additional-data-import-into-jira-issues-cube.
And here are a training video on additional data import to existing data cube: Building Reports on Different Data Sources (20 min)

Best,
Zane / support@eazyBI.com

Here is an example of how to retrieve numeric custom fields using Xray REST APIs.

You may get Test Run custom field values using two Xray REST APIs get-testruns, get-testrun and combining them with function getDocument():

  1. In eazyBI, add additional data source “REST API” and enter the get-testruns with Jira filter ID or test plan as Source data URL. The URL might look like this: http://<your_jira_domain>/rest/raven/2.0/api/testruns?savedFilterId=10800

  2. In the Content parameter section, add JavaScript code to retrieve the test run custom field values, Test Execution key, and Test key for each Test Run.
    The code for JavaScript might look like this.

    var custom_fields_result = [];
    //for each test run call another REST API to get custom field values
    getDocument( "/rest/raven/2.0/api/testrun?testExecIssueKey="+ doc.testExecKey +"&testIssueKey=" + 
    doc.testKey, {ignoreErrors: [404]}, function(result){
      if(result["customFields"]){
        _.each(result["customFields"], function(custom_fields){
          //specify name of numeric custom field
          if(custom_fields["name"]=="Logged time on execution "){
            custom_fields["testExecIssueKey"] = doc.testExecKey;
            custom_fields["testIssueKey"] = doc.testKey;
            custom_fields_result.push(custom_fields);
          }
        })
      }
    });
    return custom_fields_result;
    

    The REST API source parameters screen might look like in the picture below.

  3. In the data mapping screen, map numeric custom field value “Logged time on execution” to Measures and test execution key and test key to respective dimensions (see picture below).

Best,
Zane / support@eazyBI.com