BuildButler

Test Case Management

Automatically export Jenkins test results to TestRail, Xray, or ALM using BuildButler's JSON configuration.

BuildButler can automatically export test results from your Jenkins builds into external test case management tools. Configure one or more export rules as a JSON array — each rule matches Jenkins jobs by pattern and maps results to the target system.


TestRail

BuildButler exports test results to TestRail by creating/updating test cases, test runs, and test plans. Configure export rules as a JSON array where each object targets a set of Jenkins jobs.

TestRail configuration — credentials, job mappings, and test sync

Example configuration

[
  {
    "jobPattern": "backend/*",
    "project": "Backend",
    "testPath": "Automated Tests/API",
    "testRun": "{jobName} #{buildNumber}",
    "searchMode": "name",
    "caseType": "Automated",
    "casePriority": "Medium",
    "closeRun": true,
    "fullyQualifiedTestName": true
  },
  {
    "jobPattern": "frontend/*",
    "project": "Frontend",
    "testPath": "Automated Tests/UI",
    "testPlan": "Release {branch}",
    "milestonePath": "Releases/{branch}",
    "searchMode": "name",
    "closeRun": false,
    "closePlan": false
  }
]

Template variables

Use template variables inside string values to dynamically reference build metadata:

VariableDescription
{jobName}Jenkins job name
{buildNumber}Build number
{branch}Git branch name
{date}Build date (YYYY-MM-DD)

Configuration reference

Required fields

FieldTypeDescription
jobPatternstringGlob pattern to match Jenkins job names (e.g. backend/*, **/e2e-*)
projectstringTestRail project name
testPathstringTestRail test case path where cases are created (e.g. Automated Tests/API)

Test run and plan fields

FieldTypeDefaultDescription
testRunstringTestRail test run name. Supports template variables.
testPlanstringTestRail test plan name. When set, the test run is created inside this plan. Supports template variables.
milestonePathstringTestRail milestone path (e.g. Releases/{branch}). Creates milestones if they don't exist.
closeRunbooleanfalseAutomatically close the test run after export
closePlanbooleanfalseAutomatically close the test plan after export

Search and matching fields

FieldTypeDefaultDescription
searchModestringnameHow to match existing test cases: name (match by test name) or path (match by full class path + test name)
fullyQualifiedTestNamebooleanfalseUse the fully qualified class name as the test case title

Test case metadata fields

FieldTypeDefaultDescription
caseTypestringTestRail case type (e.g. Automated, Functional, Regression)
casePrioritystringTestRail case priority (e.g. Critical, High, Medium, Low)
caseFieldsobjectCustom TestRail case field values (e.g. {"custom_automation_tool": "Selenium"})
resultFieldsobjectCustom TestRail result field values (e.g. {"custom_environment": "staging"})

Upload behaviour fields

FieldTypeDefaultDescription
uploadModenumber0Controls how test cases are created: 0 = create new cases and update existing, 1 = create new cases only, 2 = update existing only, 3 = do not create or update cases
threadCountnumber4Number of concurrent threads for exporting data
timeoutnumber120Upload timeout in seconds

Xray

BuildButler can export test results to Xray for Jira. Xray integration maps Jenkins test results to Xray test cases, test executions, and test plans within your Jira project.

Example configuration

[
  {
    "jobPattern": "backend/*",
    "jiraProject": "BACK",
    "testPlan": "BACK-100",
    "testEnvironment": "staging",
    "searchMode": "name"
  },
  {
    "jobPattern": "frontend/*",
    "jiraProject": "FRONT",
    "testPlan": "FRONT-200",
    "testEnvironment": "production",
    "searchMode": "name"
  }
]

Configuration reference

FieldTypeRequiredDescription
jobPatternstringYesGlob pattern to match Jenkins job names
jiraProjectstringYesJira project key (e.g. BACK, FRONT)
testPlanstringNoXray test plan issue key to associate test executions with
testExecutionstringNoExisting test execution issue key. If omitted, a new execution is created.
testEnvironmentstringNoXray test environment name (e.g. staging, production)
searchModestringNoHow to match existing test cases: name or path. Default: name
revisionstringNoSource code revision to record against the test execution
labelsstring[]NoJira labels to apply to created test issues

ALM

BuildButler can export test results to Micro Focus ALM (formerly HP ALM / Quality Center). Test results are mapped to ALM test sets and test instances.

Example configuration

[
  {
    "jobPattern": "regression/*",
    "domain": "DEFAULT",
    "almProject": "RegressionSuite",
    "testSetPath": "Root/Automated/{jobName}",
    "testPath": "Subject/Automated Tests",
    "searchMode": "name"
  }
]

Configuration reference

FieldTypeRequiredDescription
jobPatternstringYesGlob pattern to match Jenkins job names
domainstringYesALM domain name
almProjectstringYesALM project name
testSetPathstringYesALM test set folder path (e.g. Root/Automated/{jobName}). Supports template variables.
testPathstringYesALM test plan folder path where test cases are created
searchModestringNoHow to match existing test cases: name or path. Default: name
runNamestringNoALM test run name. Supports template variables.
timeoutnumberNoUpload timeout in seconds. Default: 120

On this page