Child pages
  • QMetry For Jira Test Management Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View QMetry for JIRA - Test Management on the plugin site for more information.


About the Plugin

QMetry Test Management for JIRA plugin for Jenkins has been designed to seamlessly integrate your CI/CD pipeline with QMetry.

Easily configure Jenkins to submit your test results to QMetry without needing to write any code or deal with REST API. Your Test Results could be from any automation framework like Cucumber, Test NG, JUnit, QAF and more.

For more info visit QMetry Test Management for JIRA.

Read the following topics on this page:

  1. Requirements
  2. Configuring a standard Jenkins Job.
  3. Configuring QMetry for JIRA Plugin job as a post build action.
  4. Triggering the job and publishing results in JIRA.

Pre-requisites

  1. QMetry Test Management for JIRA installed in Server/Data Center or Cloud
  2. Jenkins installation

Configuring a Standard Jenkins job

Let’s create a standard Freestyle job in Jenkins.

  1. To create a new Jenkins job, click on the New Item option on the Jenkins menu.

2. Provide a name for your job.

    Select Freestyle project on the screen and then click OK.

 

 

 

3. Next, the configuration page appears where you can configure your job by various categories: General, Source Code Management (SCM), Build Triggers, Build, and Post build actions.

    

 

 

4. On the Source Code Management tab, select the appropriate option in which you have your source code. For example, here it is “Git”. So, select “Git” and provide the necessary information. (Note: You need to configure GitHub plugin in global configuration).

 

5.  Optionally, you can set Build Triggers.

Select the Build Triggers tab. Let’s just add a periodic trigger which triggers build every minute – every hour – every day (Schedule: * * * * *).

 

6. Next, Select a build step. You can select from various options: Ant, Maven, Windows batch process, etc. For example, for a maven project, trigger a maven build and specify goals.

 

 

 

Next step is to add Post-build Actions. Here, add the plugin: “QMetry Test Management for JIRA Plugin”.

 

Configuring QMetry for JIRA Test Management Plugin as a Post-build Action

Jenkins works as a bridge between QMetry Test Management and JIRA plugin. To publish results in QMetry for JIRA, define another post-build action.

  1. On the Add post-build Actions drop-down, select the "Publish test result to QMetry for JIRA" option.

2. There are two options: Cloud or Server. Based on the type of JIRA instance you have, select either JIRA Cloud or JIRA Server.

 

 

3. In case of Cloud instance for QMetry for JIRA, select the Cloud option and fill in the required data.

 

You can get more information regarding fields by clicking on the Help icon for respective fields. It explains what to enter in that particular field.

Parameters for Cloud instance:

Parameter

Type

Required

Description

Api Key

string

Yes

Your API Key. API Key is unique for a specific user in a single project. The result will be imported for the project associated with the given API Key.

Format

selection

Yes

Format of result file to be imported. Supported formats:

cucumber/json testng/xml junit/xml qas/json hpuft/xml

File URL

string

Yes

Path to your result file to be uploaded.

Example : The Jenkins plugin is expecting the file in Jenkins Workspace. 
If your workspace name is WithoutSouceCode, then you will find a folder name with "WithoutSouceCode" in your installation directory like Jenkins/Home/workspace/WithoutSouceCode. 
Your result file should be under Jenkins/Home/workspace/WithoutSouceCode/Testng-result.xml. 
The path that should be set in plugin configuration is "/Testng-result.xml"

Test Run Name

string

No

Name of the test run to be created. It will be appended with the Jenkins build Number.

Test Run Key

string

No

Existing Issue Key of Test Run. Test run will be appended with the test case and executions.

Test Asset Hierarchyselection 

Level of Hierarchy : Test Scenario-Test Case Or Test Case-Test Step

Platform

string

No

Name of Platform on which test run to be executed.

Labels

string

No

Comma separated names of Labels to be added to the test run.

Versions

string

No

Comma separated names of versions to be added to the test run.

Components

string

No

Comma separated names of Components to be added to the test run.

Sprint

string

No

Name of Sprint to be added to the test run.

Comment

string

No

Comment to be added to the test run.

JIRAFields

JSONNoCheck specific Automation custom fields possible value and format here.

 

In case of Server instance for QMetry for JIRA, select the Server option and fill in the required data.

Parameters for Server instance:

Parameter

Type

Required

Description

JIRA URL

String

Yes

Enter JIRA URL

Api Key

string

Yes

Your API Key. API Key is unique for a specific user in a single project. The result will be imported for the project associated with the given API Key.

Username

string

Yes

JIRA Username

Password

string

Yes

Password for JIRA instance.

Format

selection

Yes

Format of result file to be imported. Supported formats:

cucumber/json testng/xml junit/xml qas/json hpuft/xml

File URL

string

Yes

Path to your result file to be uploaded.

Example : The Jenkins plugin is expecting the file in Jenkins Workspace. 
If your workspace name is WithoutSouceCode, then you will find a folder name with "WithoutSouceCode" in your installation directory like Jenkins/Home/workspace/WithoutSouceCode. 
Your result file should be under Jenkins/Home/workspace/WithoutSouceCode/Testng-result.xml. 
The path that should be set in plugin configuration is "/Testng-result.xml"

Test Run Name

string

No

Name of the test run to be created. It will be appended with the Jenkins build Number.

Test Run Key

string

No

Existing Issue Key of Test Run. Test run will be appended with the test case and executions.

Test Asset Hierarchyselection 

Level of Hierarchy : Test Scenario-Test Case Or Test Case-Test Step

Platform

string

No

Name of Platform on which test run to be executed.

Labels

string

No

Comma separated names of Labels to be added to the test run.

Versions

string

No

Comma separated names of versions to be added to the test run.

Components

string

No

Comma separated names of Components to be added to the test run.

Sprint

string

No

Name of Sprint to be added to the test run.

Comment

string

No

Comment to be added to the test run.

JIRAFields

JSONNoCheck specific Automation custom fields possible value and format here

 

4.   On successful completion of the process, you can see the console output. It displays statistics for Tests run, Failures, Errors, Skipped, etc.

 

 

5. Finally check your JIRA account.

    In case of Cloud instance, you can see the success result for your test cases.

 

JIRA Fields

i) How to get Custom Field ID?

Rest call to JIRA to get all JIRA fields.

The following URL gives all custom fields get ID for selected custom fields that you want to apply.

<Jira_Base_URL>/rest/api/2/field 

 

ii) Base format for custom fields.

 

[
  {
    "testRun": [
      {
      }
    ]
  },
  {
    "testScenario": [
      {
      }
    ]
  },
  {
    "testCase": [
      {
      }
    ]
  }
]

 

 

iii) Standard Custom Field Types

The following types are for reference only, other types of Custom Field Types are also supported.

 

Custom Field Type
Validation Rule
Example
CheckboxesThe checkbox accepts comma separated multiple values{
  "customfield_10200": [
    {
      "value": "true"
    },
    {
      "value": "false"
    }
  ]
}
Date PickerThe Date picker accepts only specified format Date{
  "customfield_10202":"2017-09-06"
}
Date Time PickerThe Date time picker accepts only specified format Date and time{
  "customfield_10203": "2013-03-01T00:00:00.000+0400"
}
Number FieldThe Number field accepts any number with decimal{
  "customfield_10205": 2876784
}
Radio ButtonsThe radio button accepts single value from JIRA fields{
  "customfield_10206": {
    "value": "option1"
  }
}
Select List (multiple choices)The Select List Multiple accepts comma separated multiple values{
  "customfield_10208": [
    {
      "value": "Select List Multiple 1"
    },
    {
      "value": "Select List Multiple 2"
    }
  ]
}
Select List (single choice)The radio button accepts single value from JIRA fields{
  "customfield_10209": {
    "value": "Select List single 1"
  }
}
Text Field (multi-line)It accepts text in multiple lines{
  "customfield_10210": "this is sample.\nexample"
}
Text Field (single line)It accepts text in single line{
  "customfield_10211": "this is sample.example"
}
URL FieldIt accepts Web URL{
  "customfield_10212": "http://www.url-encode-decode.com/"
}
User Picker (single user)The User field accepts only available JIRA users{
  "customfield_10213": {
    "name": "admin"
  }
}

 

iv) JSON Example

If you want to set 2 custom fields (checkbox, single text) on test run issue type and one custom fields (Radio Button) on scenario and test case level.

 

"JIRAFields":
[
  {
    "testRun": [
      {
        "customfield_10200": [
          {
            "value""true"
          },
          {
            "value""false"
          }
        ]
      },
      {
        "customfield_10211""this is sample.example"
      }
    ]
  },
  {
    "testScenario": [
      {
        "customfield_10206": {
          "value""option1"
        }
      }
    ]
  },
  {
    "testCase": [
      {
        "customfield_10206": {
          "value""option1"
        }
      }
    ]
  }
]

 

 

1 Comment

  1. How do I use this plugin with jenkins dsl