API for Reports


Get System Gadget ID

Dashboard key

DashboardsDashboard Key
My Dashboardmydashboard
Requirement Reportrequirement
Test Case Reporttestcase
Issue Analysis Reportissueanalysis
Issue Trends Reportissuetrends
Top Issues Reporttopissues
Execution Summary Reportexecution-summary
Approval Workflow Reportapproval-workflow
Login Reportlogin
Reusability Reportreusability
Audit Log Reportauditlog

Get System Gadget ID

API

https://<QMetry URL>/rest/analytics/latest/dashboards/<dashboard key>?isSystem=true

Refer the above table to get dashboard key of the dashboard you want to export

MethodGET
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>

Request Body(empty)
Response

Code : 200

Response success
{
    "data": {
        "gadgets": [
            {
                "mappingID": 8,
                "gadget": "{\"name\":\"Manual Vs Automated\", \"gadgetID\": \"manualvsautomated\", \"isSystem\": 1, \"isFilter\": true, \"w\": 1, \"h\": 1, \"x\": 0, \"y\": 0 }",
                "name": "Manual Vs Automated",
                "description": "Showing summary of Manual vs Automated test cases based on testing type."
            },
            {
                "mappingID": 9,
                "gadget": "{\"name\":\"Test Cases With Issues\", \"gadgetID\": \"tcwithissue\", \"isSystem\": 1, \"isFilter\": true, \"w\": 1, \"h\": 1, \"x\": 1, \"y\": 0 }",
                "name": "Test Cases With Issues",
                "description": "Showing summary of Test cases where issues are linked and Test cases without issues."
            },
            {
                "mappingID": 10,
                "gadget": "{\"name\":\"Planned Test Cases\", \"gadgetID\": \"tcplanned\", \"isSystem\": 1, \"isFilter\": true, \"w\": 2, \"h\": 1, \"x\": 0, \"y\": 1 }",
                "name": "Planned Test Cases",
                "description": "Showing summary of test case planned or unplanned for execution. Test case those are linked with test suites are \"Planned\" for execution. Test case those are not linked with test suites are considered \"Unplanned\" for execution."
            },
            {
                "mappingID": 11,
                "gadget": "{\"name\":\"Test Case Summary\", \"gadgetID\": \"tcsummary\", \"isSystem\": 1, \"isFilter\": true, \"w\": 2, \"h\": 1, \"x\": 0, \"y\": 2 }",
                "name": "Test Case Summary",
                "description": "Showing summary of test cases grouped by their workflow status/priority/test category."
            }
        ],
        "name": "Test Case Report",
        "dashboardKey": "testcase"
    }
}

Code : 400

Response failure
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Export System Gadget without filters

APIhttps://<QMetry base URL>/rest/analytics/latest/gadget/exportComments
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>


Request Body{
"isSystemGadget": 1,
"gadgetKey": "<gadget ID>"
}
Ggadget ID to be retrieved from api - Get System Gadget ID
Response

Code : 200

Response success
{
    "requestId": "3041507c-95d0-4628-a49d-d95b7632197c",
    "success": true
}

Code : 400

Response failure
{
    "success": false,
    "code": "RP.REPORT_GADGET_NOT_FOUND",
    "message": "Gadget not exist. "
}
This requestId to be used in API- Check progress and get download link for exported report data

Export System Gadget with filters

APIhttps://<QMetry base url>/rest/analytics/latest/gadget/exportComments
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>


Request Body

{
     "isSystemGadget": 1,
     "gadgetKey": "<gadget key>",
     "filterValue": [{
                           "type": "multiselect",
                           "field": "`@Filter.project`",
                           "value": [9]
                         }]
}

gadget ID to be retrieved from API - Get System Gadget ID
Response

Code : 200

Response success
{
    "requestId": "3041507c-95d0-4628-a49d-d95b7632197c",
    "success": true
}

Code : 400

Response failure
{
    "success": false,
    "code": "RP.REPORT_GADGET_NOT_FOUND",
    "message": "Gadget not exist. "
}
This requestID can be used in APIs Check progress and get download link for exported report data

Get Dashboard Key for QMetry Custom Dashboards > My Dashboards

APIhttps://<QMetry Base URL>/rest/analytics/latest/dashboards/custom/search
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>

Request Body
Request
{
	"start": 0,
	"limit": 50,
	"page": 1,
	"isSystem": false
}
Response


Response success - Code : 200
{
    "data": [
        {
            "name": "My Custom Dasboard",
            "isPrivate": 1,
            "dashboardKey": "REFpSr",
            "isSystem": 0
        }
    ],
    "total": 1
}
Response failure - Code : 400
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Get Dashboard Key for QMetry Custom Dashboards > Shared Dashboards


APIhttps://<QMetry Base URL>/rest/analytics/latest/dashboards/sharedWithUser
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>

Request Body
Request
{
	"start": 0,
	"limit": 50,
	"page": 1,
	"isSystem": false
}
Response


Response success - Code : 200
{
    "data": [
        {
            "name": "My Custom Dasboard",
            "isPrivate": 0,
            "dashboardKey": "REFpSr",
            "isSystem": 0
        },
        {
            "name": "Traceability Dashboard",
            "isPrivate": 1,
            "dashboardKey": "G3hoS5",
            "isSystem": 0
        }
    ],
    "total": 2
}
Response failure - Code : 400
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Get Custom Gadget ID

API

https://<QMetry Base URL>/rest/analytics/latest/dashboards/{{dashboard key}}?isSystem=false

Get dashboard key using 1017514964

MethodGET
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report needs to be exported>

Request Body(empty)
Response


Response success - code 200
{
    "data": {
        "gadgets": [
            {
                "mappingID": 134,
                "gadget": "{\"name\":\"Custom Traceability Report\",\"dashboardKey\":\"G3hoS5\",\"gadgetID\":\"gr8uqSL\",\"id\":\"gadget-134\",\"isSystem\":false,\"cols\":1,\"rows\":1,\"isFilter\":true,\"hideLoader\":false,\"metadata\":\"[{\\\"type\\\":\\\"table\\\"}]\",\"filterValue\":[{\"type\":\"multiselect\",\"field\":\"`@Filter.project`\",\"isProject\":true,\"userID\":[13],\"value\":[9]}],\"filterAlias\":\"Default Filter\",\"mappingID\":134,\"x\":0,\"y\":0,\"w\":1,\"h\":1,\"validFilter\":true,\"validGadgetName\":true,\"errorMessage\":\"\",\"isDirty\":false,\"description\":\"Project Filter Traceability Report\",\"renameFlag\":false,\"projectKeys\":[{\"id\":\"project\",\"name\":\"project\"}],\"releaseKeys\":[],\"projectKeyIndex\":[],\"releaseKeyIndex\":[],\"showFilter\":false,\"filterId\":59}",
                "name": "Custom Traceability Report",
                "description": "This is a custom Traceability Report"
            },
            {
                "mappingID": 135,
                "gadget": "{\"name\":\"Tabular Matrix Tracebility Report \",\"dashboardKey\":\"G3hoS5\",\"gadgetID\":\"1pohRSv\",\"id\":\"gadget-1\",\"isSystem\":false,\"cols\":1,\"rows\":1,\"isFilter\":0,\"hideLoader\":false,\"metadata\":\"[{\\\"type\\\":\\\"table\\\"}]\",\"filterValue\":\"[]\",\"filterAlias\":\"Default Filter\"}",
                "name": "Tabular Matrix Traceability Report ",
                "description": "This is Tabular Matrix  Traceability Report "
            }
        ],
        "name": "Traceability Report Dashboard",
        "dashboardKey": "G3hoS5",
        "isShared": false
    }
}
Response failure - code 400
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Export Custom Gadget with filter

APIhttps://<QMetry Base URL>/rest/analytics/latest/gadget/export
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>

Request Body{
     "isSystemGadget": 0,
     "gadgetKey": "gr8uqSL",
     "filterValue": [{
                             "type": "multiselect",
                             "field": "`@Filter.project`",
                             "value": [9 ]
                         }]
}
Response


Reponse success
{
    "requestId": "b448f4ac-64cb-4d6c-9454-a98456ac1cf3",
    "success": true
}
Response failure
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Export a Custom Gadget without a Filter

APIhttps://<QMetry Base URL>/rest/analytics/latest/gadget/exportComment
MethodPOST
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>


Request Body{
"isSystemGadget": 0,
"gadgetKey": "<gadget ID>"
}
Gadget ID to be retrieved from API - Get Custom Gadget ID.
Response


Response success - code 200
{
    "requestId": "dda590fb-ed51-4dd5-bd0b-a0f07bb1c51d",
    "success": true
}
Response failure - code 400
{
    "success": false,
    "code": "RP.REPORT_DASHBOARD_NOT_FOUND",
    "message": "Dashboard not exist."
}

Check progress and get download link for exported report data

API

https://<QMetry Base URL>/rest/analytics/latest/exports/{{request ID}}/progress

Request ID should be retrieved from API to Export System Gadget with filter

Comments
MethodGET
Request Header

apiKey : <Your Open API key>

Content-Type : <application/json>

project : <Project key for which the report to be exported>


Request Body

(empty)

gadget ID to be retrieved from API - Get System Gadget ID
Response

Code : 200

Response success
{
    "totalRecords": 5,
    "processedRecords": 5,
    "status": "Completed",
    "downloadUrl": "https://<QMetry URL>/rest/analytics/latest/exports/e431...-7c94da91419b/download?token=eyJhbG.....0e4H47c"
}
Response success
{
    "totalRecords": 500,
    "processedRecords": 5,
    "status": "In_progress",
    "downloadUrl": 
}

Code : 400

Response failure
{
    "success": false,
    "code": "RP.REPORT_GADGET_NOT_FOUND",
    "message": "Gadget not exist. "
}
Response success
{
    "totalRecords": 5,
    "processedRecords": 0,
    "status": "Failed",
    "downloadUrl":
}