Scripting for Issues

You can use the following scripting-features to control the issue-detection and -creation features of BiG EVAL.

Please note:

  • The following commands have only an effect when a testcase failes and when it creates a new issue. That means that the issue-creation must be activated first in the testcase-editor.
  • If an issue already exists, the testresult will only be appended to the issue. Title, description, responsible user and assigned user will not be changed. In this case, the commands have no effect.

Setting the Issue-Identifier

Every issue created in BiG EVAL is identified by a unique character-string. Usually the identifier corresponds with the ID of the failed testcase. But it could also be the ID of a erroneous record identified by a testcase. This allows to group testresults together.

Usually you setup this behavior in the testeditor. But you can also overwrite the behavior in the control-script of the testcase by setting up a userdefined character-string as the identifier.

Overwriting the identifier makes sense in the example of iterating through a list of records. For example a list of sales-territories. In this case you want an issue for each of them. So you can add the ID or name of the sales-territory to the identifier.

SetIssueIdentifier("example-identifier");

Setting the Title and Description

Use the following methods to set the title and the description of an issue that may get created when the testcase fails.

Setting the Title:

SetIssueTitle("My Title");

Setting the Description:

SetIssueDescription("This is my very long description...");

Setting responsible Person

Use the following methods to set the responsible person of an issue. You can either use the BiG EVAL ID, the Email-Address or the username of the person.

SetIssueOwnedBy("e0c67a85-e967-4a16-b88f-36419111f3d8");

or:

SetIssueOwnedBy("[email protected]");

Assigning issue to a Person

Use the following methods to assign an issue to a specific person. You can either use the BiG EVAL ID, the Email-Address or the username of the person.

SetIssueAssignedTo("e0c67a85-e967-4a16-b88f-36419111f3d8");

or:

SetIssueAssignedTo("[email protected]");

Full Example

// Query the available sales stores from the ERP.
var stores = QueryTable("AW ERP", "SELECT Name, ManagerEmail FROM Sales.Store");

// Loop through all the stores and execute the testcase for each of them.
foreach(DataRow storeRow in stores.Rows)
{
    // Extract ID and Name of the current sales territory.
    var storeName = storeRow["Name"].ToString();
    var managerEmail = storeRow["ManagerEmail"].ToString();

    // Write a comment to the test-result to show the current store.
    SetComment($"Store: {storeName}");

    // Configure the issue-tracking
    SetIssueIdentifier($"{Test.TestId}-{storeName}");
    SetIssueTitle($"Customer count test failed for store {storeName}");
    SetIssueDescription("The test failed because customer-count couldn't be resolved correctly.");
    SetIssueOwnedBy(managerEmail);
    SetIssueAssignedTo(managerEmail);

    // Set the name of the store as a parameter
    SetParameter("StoreName", storeName);

    // Execute the test.
    await ExecuteAsync();
}
Table of Contents