Versions Compared

Key

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

Table of Contents


Info
titleWorking Sample

Please look at Sample Projects for Automation sections for a more concrete end-to-end example.

...

Method : POST

REQUEST HEADER :

  • Content-Type : application/json
  • {generated-api-key}
  • Basic ZnJlZDpmcmVk

...

ParameterTypeRequiredDescriptionDefault
formatstringYesFormat of result file to be imported. Supported formats:
  1. CUCUMBER 
  2. TESTNG 
  3. JUNIT 
  4. QAF 
  5. HPUFT 
  6. SPECFLOW
NA
testCycleToReusestringNoIssue Key of the test cycle to be reusedNA
environmentstringNoName of the environment on which test cycle has to be executedNo Environment
buildstringNoName of the build for test cycle executionBlank
isZipbooleanNo (Yes for QAF)Pass true for ZIP upload or pass false for single file uploadfalse
attachFilebooleanNo

Pass true to upload attachments in execution. For more details, Refer to automation help documents.

This parameter is supported only for-

  • QAF
  • Cucumber
false
fieldsJSONNo

Provide additional fields to be added on a test case or test cycle level. Refer to the following table for more.

Note : 

  • If the cycle is reused, fields of the test cycle will be ignored.
  • If the Test case version is reused, fields of the test cases will be ignored.
  • The Test case fields provided via automation will be added to ALL the Test cases getting created via automation. 
NA

...

Supported FieldsTypeTest CycleTest CaseDefaultComment
labelsarrayYesYesnull
componentsarrayYesYesnull
statusstringYesYesTO DO
prioritystringYesYesMedium
fixVersionIdnumberYesYesnull
sprintIdnumberYesYesnull
summarystringYesNoAutomated Test Cycle

description

string

Yes

Yes

null


assignee

string

Yes

Yes

Account Key of current User


Valid User Account Key (Refer to Get account key of the user - linksection below)

For example - "JIRAUSER11801"

reporter

string

Yes

Yes

Account Key of current User


Valid User Account Key (Refer to Get account key of the user - linksection below)

For example - "JIRAUSER11801"

estimatedTime

string

No

Yes

null


Pass time in ‘HH:mm’ format

plannedStartDate

string

Yes

No

null

Pass date in 'dd/MMM/yyyy HH:mm' format

plannedEndDate

string

Yes

No

null

Pass date in 'dd/MMM/yyyy HH:mm' format

customFields

array

Yes

Yes

null

  • This array contains JSON object which has name and value property.

  • name property represents name of custom field, user can get it from custom fields screen inside configuration menu.

  • value property represents value of custom field.

    • For Date type custom field, pass value in 'dd/MMM/yyyy' format.

    • For DateTime type custom field, pass value in 'dd/MMM/yyyy HH:mm' format.

    • For Number type custom field, pass any numeric value

    • For Single option custom field like Radio button, Single Dropdown etc, pass option value as string. Ex. 'high'

    • For Multi options custom field like Checkbox, Multi Dropdown etc, pass the value as a comma-separated string. Ex. 'high,medium,low'

    • For Single User picker type custom field, pass Jira Account Key of the user and For Multi-User picker, pass a comma-separated Jira Account Key of users.
    • For Labels type custom field pass value as comma separated string. Ex. 'tag1,tag2'
    • For Cascade type custom field, Pass two level of values. "value" node represents Level 1 dropdown option and cascadeValue node represents Level 2 dropdown option. Ex. "value": "option1", "cascadeValue": "option1_A"


Get the account key of a User


Image Added



Sample Request

Code Block
{
    "format": "cucumber",
    "attachFile": true,
    "isZip": false,
    "environment": "Chrome",
    "build": "4.1.0",
    "fields": {
        "testCycle": {
            "labels": [
                "label1",
                "label2"
            ],
            "components": [
                "component1"
            ],
            "priority": "High",
            "status": "To Do",
            "summary": "Test Cycle Summary Automation with custom fields",
            "description": "Test Cycle Automation Description",
            "assignee": "JIRAUSER11801",
            "reporter": "JIRAUSER11600",
            "plannedStartDate": "20/May/2021 00:00",
            "plannedEndDate": "30/May/2021 00:00",
            "customFields": [{
                    "name": "Check Boxes",
                    "value": "MCB 1,MCB 2"
                },
                {
                    "name": "Date picker",
                    "value": "29/May/2021"
                },
                {
                    "name": "Date time picker",
                    "value": "29/May/2021 14:55"
                },
                {
                    "name": "Multi DropDown",
                    "value": "MDD 2,MDD 1"
                },
                {
                    "name": "Multi line text field",
                    "value": "QMetry Automation Testing using cucumber framework "
                },
                {
                    "name": "Number field",
                    "value": 1234567890
                },
                {
                    "name":"Cascade Drop down",
                    "value":"User Details", "cascadeValue": "Email"
                },
                {
                    "name": "Single DropDown",
                    "value": "DD2"
                },
                {
                    "name": "Single line Textbox",
                    "value": "QMetry Automation Testing using cucumber framework"
                },
                {
                    "name": "Custom Radio Button",
                    "value": "Test C"
                },
                {
                    "name":"Single User Picker",
                    "value":"JIRAUSER11600"
                },
                {
                    "name":"Multiple user picker field",
                    "value":"JIRAUSER11801,JIRAUSER11800,JIRAUSER11702"
                },
                 {
                    "name":"Custom field type Label for Test Cycle",
                    "value":"TestLabel"
                }
            ]
        },
        "testCase": {
            "labels": [
                "label1",
                "label2"
            ],
            "components": [
                "component1"
            ],
            "priority": "High",
            "status": "To Do",
            "sprintId": "1000",
            "fixVersionId": "10000",
            "description": "Automated generated Test Case",
            "assignee": "JIRAUSER11702",
            "reporter": "JIRAUSER11800",
            "estimatedTime": "10:10",
            "customFields": [{
                    "name": "Check Boxes",
                    "value": "MCB 1,MCB 2"
                },
                {
                    "name": "Date Picker",
                    "value": "29/May/2021"
                },
                {
                    "name": "Date Time Picker",
                    "value": "29/May/2021 14:55"
                },
                {
                    "name": "Multi DropDown",
                    "value": "MDD 2,MDD 1"
                },
                {
                    "name": "Multi line text field",
                    "value": "QMetry Automation Testing using cucumber framework "
                },
                {
                    "name": "Number field",
                    "value": 1234567890
                },
                {
                    "name":"Cascade Drop down",
                    "value":"User Details", "cascadeValue": "Email"
                },
                {
                    "name": "Single DropDown",
                    "value": "DD2"
                },
                {
                    "name": "Single Line Textbox",
                    "value": "QMetry Automation Testing using cucumber framework"
                },
                {
                    "name": "Radio Buttons",
                    "value": "Test C"
                },
                {
                    "name":"Single User Picker",
                    "value":"JIRAUSER11600"
                },
                {
                    "name":"Multiple User Picker",
                    "value":"JIRAUSER11801,JIRAUSER11800,JIRAUSER11702"
                },
                {
                    "name":"Custom Labels for Test Case",
                    "value":"TestLabel"
                }
            ]
        }
    }
}
 

...

Responses

ResponseDescription

STATUS 200

Returned if results file is uploaded successfully. The import process might take a while and you would be notified (by email or checking the status of the created test run) once the process completed.

Example

Code Block
{
    "url": "https://{{jira base url}}/rest/qmetry/automation/latest/importresult/submitFile?trackingId=3d19c19d-935c-4d08-b3de-74a38b5042a0",
    "trackingId": "3d19c19d-935c-4d08-b3de-74a38b5042a0"
}

 
STATUS 400

                                  

Returned if import fails

If unsupported framework is sent in request

Code Block
{
  "status":400,
  "errorMessage":"Framework ‘xyz’ is not supported.",
  "timestamp":"28/May/2019 04:58"
}


If zip file is not sent in QAF framework request

Code Block
{  
  "status":400,
  "errorMessage":"Zip file format is required for QAF framework.",
  "timestamp":"28/May/2019 05:00"
} 


If one or more fields have invalid value

Code Block
{
      "status":400,
      "errorMessage": "The supplied fields are invalid",
      "errors":[
        "Provided Component Name(s) xyz not found ",
        "Provided Label Name(s) xyz not found"
      ],
      "timestamp":"29/May/2019 12:44"
}


...

  • Content-Type : multipart/form-data
  • {generated-api-key}
  • Basic ZnJlZDpmcmVk

Request Body - Binary : Your result file to be uploaded. Supported file extensions: .json, .xml and .zip (zip file must contain files of the format given in the 'format' param).

...

Responses

ResponseDescription

STATUS 204

Returned if the file is uploaded successfully.


2.3 See Progress

This API is used to check the progress of automation result import. 

...

GET
  • application/json
  • apiKey : {generated-api-key}
  • Basic ZnJlZDpmcmVk


Responses

ResponseDescription

STATUS 200

Returned if parameters are validated successfully.

Example

Code Block
{  
    "format":"QAF",
    "fileName":"1558945546874_840ba1e3-bf14-4f08-b19c-e5de6447711b.zip",
    "processStatus":"VALIDATION/PARSING/CREATING_ASSETS/SUCCESS",
    "importStatus":"SUCCESS/INPROCESS/FAILED",
    "startTime":"2019-05-27T08:25:47.000+0000",
    "endTime":null,
    "fileSize":1500,
    "trackingId":"840ba1e3-bf14-4f08-b19c-e5de6447711b",
    "files":[]
}


STATUS 400

Returned in invalid trackingId

If trackingId is invalid


Example

Code Block
{
  "status":404,
  "errorMessage":"No import details found for given tracking id '840ba1e3-bf14-4f08-b19c-e5de6447711b'",
  "timestamp":"02/Apr/2020 16:19"
}

...