Document toolboxDocument toolbox

(8.5-en) REST API

This documentation explains the list of publicly available REST API in synapseRT NextGen to perform the products own actions via programmatically.

Add Test Cases to Test Plan

POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/addMembers

Ā Request

Ā Example

{
	"testCaseKeys":["ABC-1","ABC-2","ABC-3"]
}
Ā Response

STATUS 200Ā Returned if the Test Cases are successfully added to the Test Plan

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Add Test Cycle to Test Plan

POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/addCycle

Ā Request

Example

{
	"name":"Sample Cycle",
	"environment":"Firefox",
	"build":"8.1"
}
Ā Response

STATUS 200Ā Returned if the Test Cycle is successfully added to the Test Plan

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Update Test Cycle Status

PUT /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/wf/{action}

Ā Request

Valid actions are

  • Start
  • Complete
  • Abort
  • Resume
Ā Response

STATUS 200Ā Returned if the Test Cycle status is updated successfully

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Update Test Run

POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/updateTestRun

Ā Request

Example

{
	"testcaseKey":"ABC-4",
	"result":"Passed",
	"comment":"Updated through REST"
}

Ā Response

STATUS 200Ā Returned if the Test Run is updated successfully

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Link Bug to Test Run

POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/linkBugToTestRun

Ā Request

Example

{
	"testcaseKey":"ABC-5",
	"bugs":["ABC-6","ABC-7"]
}

Ā Response

STATUS 200Ā Returned if the Bug is successfully linked to the Test Run

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Cycles in a Test Plan

GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycles

Ā Response

STATUS 200Ā Returned if the Test Cycles are successfully retrieved

Example

 [
  {
    "name": "REST API Cycle 1",
    "id": 16,
    "environment": "Firefox",
    "status": "Active",
    "deleteable": false,
    "active": true,
    "aborted": false,
    "cycleStartedDate": "2017-01-25T15:05:13.670+0800",
    "plannedStartDate": "2017-01-25",
    "plannedEndDate": "2017-01-25",
    "build": "8.5.0.1-alpha6",
    "draft": false
  },
  {
    "name": "REST API Cycle 2",
    "id": 17,
    "environment": "Chrome",
    "status": "Completed",
    "deleteable": false,
    "active": false,
    "aborted": false,
    "cycleStartedDate": "2017-01-25T15:15:39.997+0800",
    "cycleCompletedDate": "2017-01-25T15:15:54.513+0800",
    "plannedStartDate": "2017-01-26",
    "plannedEndDate": "2017-01-26",
    "build": "8.5.0.1-alpha6",
    "draft": false
  },
  {
    "name": "REST API Cycle 3",
    "id": 18,
    "environment": "IE 11",
    "status": "Aborted",
    "deleteable": false,
    "active": false,
    "aborted": true,
    "cycleStartedDate": "2017-01-25T15:16:01.577+0800",
    "cycleCompletedDate": "2017-01-25T15:16:05.143+0800",
    "plannedStartDate": "2017-01-27",
    "plannedEndDate": "2017-01-28",
    "build": "8.5.0.1-alpha6",
    "draft": false
  },
  {
    "name": "REST API Cycle 4",
    "id": 19,
    "environment": "Safari",
    "status": "Draft",
    "deleteable": true,
    "active": false,
    "aborted": false,
    "plannedStartDate": "2017-01-28",
    "plannedEndDate": "2017-01-30",
    "build": "8.5.0.1-alpha6",
    "draft": true
  }
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Runs in a Test Cycle

GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/testRuns

Ā Response

STATUS 200Ā Returned if the Test Runs are successfully retrieved

Example

[
	{
		"ID": 1,
		"summary": "Case 1",
		"status": "Failed",
		"testCaseKey": "TP-3",
		"executedBy": "admin",
		"attachments":
		[
			{
				"ID": 2,
				"fileName": "atlassian-jira (1).log",
				"mimeType": "application/octet-stream"
			}
		],
		"bugs":
		[
			{
				"id": 10100,
				"key": "TP-6",
				"summary": "bug"
			}
		],
		"executionTimeStamp": "2016-04-29T19:15:57.105+0530"
	},
	{
		"ID": 2,
		"summary": "Case 2",
		"status": "Not Tested",
		"testCaseKey": "TP-4",
		"executedBy": "admin",
		"bugs":
		[
			{
				"id": 10100,
				"key": "TP-6",
				"summary": "bug"
			},
			{
				"id": 10300,
				"key": "TP-9",
				"summary": "test 1"
			},
			{
				"id": 10301,
				"key": "TP-10",
				"summary": "bug-2"
			}
		],
		"executionTimeStamp": "2016-04-29T11:06:30.011+0530"
	}
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Runs in a Test Cycle with Cycle ID

GETĀ /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleId}/testRunsByCycleId

Ā Response

STATUS 200Ā Returned if the Test Runs are successfully retrieved

Example

[
	{
		"ID": 1,
		"summary": "Case 1",
		"status": "Failed",
		"testCaseKey": "TP-3",
		"executedBy": "admin",
		"attachments":
		[
			{
				"ID": 2,
				"fileName": "atlassian-jira (1).log",
				"mimeType": "application/octet-stream"
			}
		],
		"bugs":
		[
			{
				"id": 10100,
				"key": "TP-6",
				"summary": "bug"
			}
		],
		"executionTimeStamp": "2016-04-29T19:15:57.105+0530"
	},
	{
		"ID": 2,
		"summary": "Case 2",
		"status": "Not Tested",
		"testCaseKey": "TP-4",
		"executedBy": "admin",
		"bugs":
		[
			{
				"id": 10100,
				"key": "TP-6",
				"summary": "bug"
			},
			{
				"id": 10300,
				"key": "TP-9",
				"summary": "test 1"
			},
			{
				"id": 10301,
				"key": "TP-10",
				"summary": "bug-2"
			}
		],
		"executionTimeStamp": "2016-04-29T11:06:30.011+0530"
	}
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPlanIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Add Test Steps to a Test Case

POST /rest/synapse/latest/public/testCase/{testCaseIssueKey}/addSteps

Ā Request

Example

[
	{
		"step":"Login with valid username and password",
		"stepData": "It is step data A for testing",
		"expectedResult":"Successful Login"
	},
	{
		"step":"Check if Dashboard is loaded",
		"stepData": "It is step data B for testing",
		"expectedResult":"Default Dashboard successfully loaded"
	}
]
Ā Response

STATUS 200Ā Returned if the Test Steps are successfully added to the Test Case

Example

[
	{
		"ID":1,
		"tcId":10001,
		"step":"Login with valid username and password",
		"expectedResult":"Successful Login",
		"sequenceNumber":1
		
	},
	{
		"ID":2,
		"tcId":10001,
		"step":"Check if Dashboard is loaded",
		"expectedResult":"Default Dashboard successfully loaded",
		"sequenceNumber":2
	}
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testCaseIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Steps of a Test Case

GET /rest/synapse/latest/public/testCase/{testCaseIssueKey}/steps

Ā Response

STATUS 200Ā Returned if the Test Steps are successfully retrieved from the Test Case

Example

[
	{
		"ID":1,
		"tcId":10001,
		"step":"Login with valid username and password",
		"expectedResult":"Successful Login",
		"sequenceNumber":1
		
	},
	{
		"ID":2,
		"tcId":10001,
		"step":"Check if Dashboard is loaded",
		"expectedResult":"Default Dashboard successfully loaded",
		"sequenceNumber":2
	}
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testCaseIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Link Test Case to a Requirement

POST /rest/synapse/latest/public/requirement/{requirementIssueKey}/linkTestCase

Ā Request

Example

{
	"testCaseKeys":["ABC-10","ABC-11"]
}
Ā Response

STATUS 200Ā Returned if the Test Cases are successfully linked to the Requirement

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the requirementIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Add Child Requirements to a Requirement

POST /rest/synapse/latest/public/requirement/{requirementIssueKey}/addChildren

Ā Request

Example

{
	"requirementKeys":["ABC-12","ABC-13"]
}
Ā Response

STATUS 200Ā Returned if the Child Requirements are successfully linked to the Requirement

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the requirementIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Cases in a Test Plan

GET /rest/synapse/latest/public/testPlan/{testplanIssueKey}/members

Ā Response

STATUS 200Ā Returned if the Test Cases are successfully retrieved from the Test Plan

Example

[
  {
    "ID": 1138,
    "tcId": 15414,
    "tpId": 15416,
    "testCaseKey": "SPC-1",
    "testCaseSummary": "Verify if the user name is correct"
  },
  {
    "ID": 1140,
    "tcId": 15415,
    "tpId": 15416,
    "testCaseKey": "SPC-2",
    "testCaseSummary": "Verify if the age name is correct"
  }
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testPaseIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Test Run Details

GET /rest/synapse/latest/public/testRun/{runID}

Please note that runID doesn't include the prefix 'TR'.Ā 

Ā Response

STATUS 200Ā Returned if the Test Run Details are successfully retrieved

Example

{
  "ID": 3149,
  "summary": "Return error if name is not correct",
  "status": "Failed",
  "lozenge": "aui-lozenge ",
  "testerName": "cma",
  "comment": "<p>This Test Case is failed.</p>",
  "testCaseKey": "FRS-15",
  "testCaseId": 15714,
  "type": 0,
  "testRunDetails": {
    "testRunSteps": [
      {
        "ID": 15173,
        "step": "Login 'FRS' system valid u/p.",
        "expectedResult": "User logged in successfully.",
        "status": "Passed",
        "testRunStepBugsWrapper": [],
        "testRunStepAttachments": []
      },
      {
        "ID": 15174,
        "step": "Choose any ticket and click on '*Purchase*' button.",
        "stepData": "",
        "expectedResult": "It redirects to 'Purchase' page.",
        "status": "Passed",
        "testRunStepBugsWrapper": [],
        "testRunStepAttachments": []
      },
      {
        "ID": 15175,
        "step": "Specify your ID and Name in '{color:red}Passenger Name{color}' section.",
        "stepData": "",
        "expectedResult": "",
        "status": "Passed",
        "testRunStepBugsWrapper": [],
        "testRunStepAttachments": []
      },
      {
        "ID": 15176,
        "step": "Click 'Check' button. ",
        "expectedResult": "It returns an error: 'Your ID and Name are inconsistent, please check again!'.",
        "actualResult": "It is failed due to FRS-23",
        "status": "Failed",
        "testRunStepBugsWrapper": [
          {
            "id": 15722,
            "key": "FRS-23",
            "summary": "There is no error returned."
          }
        ],
        "testRunStepAttachments": [
          {
            "ID": 61,
            "fileName": "Performance_Manage_REQs_Loading_Issue.jpg",
            "mimeType": "image/jpeg"
          }
        ]
      },
      {
        "ID": 15177,
        "step": "*Below is an inline image for Step 5:*\n!Image_for_DEMO_Purpose.png|thumbnail!",
        "stepData": "",
        "expectedResult": "*Below is an inline image for Step 5:*\n!Image_for_DEMO_Purpose.png|thumbnail!",
        "status": "Failed",
        "testRunStepBugsWrapper": [
          {
            "id": 15919,
            "key": "FRS-52",
            "summary": "[8.4.1.1-alpha3] Regression - Defect 3 (Improvement)"
          }
        ],
        "testRunStepAttachments": []
      }
    ],
    "automationRunSteps": [],
    "testRunHistory": [
      {
        "activityType": "Status",
        "activity": "Passed",
        "executorName": "Cheney Ma",
        "executionTime": 1478160384762,
        "testRunId": 3149
      },
      {
        "activityType": "Status",
        "activity": "Failed",
        "executorName": "Cheney Ma",
        "executionTime": 1478160387086,
        "testRunId": 3149
      },
      {
        "activityType": "Issue",
        "activity": "+ FRS-23",
        "executorName": "Cheney Ma",
        "executionTime": 1478160401266,
        "testRunId": 3149
      },
      {
        "activityType": "Issue",
        "activity": "+ FRS-52",
        "executorName": "Cheney Ma",
        "executionTime": 1480489278071,
        "testRunId": 3149
      }
    ],
    "testRunBugs": [
      {
        "id": 15722,
        "key": "FRS-23",
        "summary": "There is no error returned."
      },
      {
        "id": 15919,
        "key": "FRS-52",
        "summary": "[8.4.1.1-alpha3] Regression - Defect 3 (Improvement)"
      }
    ],
    "testRunAttachments": [
      {
        "ID": 62,
        "fileName": "Performance_Manage_REQs_Loading_Issue.jpg",
        "mimeType": "image/jpeg"
      }
    ],
    "prevRunId": 3148,
    "nextRunId": 3150
  },
  "bugs": [
    {
      "id": 15722,
      "key": "FRS-23",
      "summary": "There is no error returned."
    },
    {
      "id": 15919,
      "key": "FRS-52",
      "summary": "[8.4.1.1-alpha3] Regression - Defect 3 (Improvement)"
    }
  ]
}

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the runID provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Update Test Run Step Result

POSTĀ /rest/synapse/latest/public/testRun/updateStep/

Ā Request

Example

{ 
	"runStepId":2, "result":"Failed", "actualResult":"Updated via REST with bugs", "bugs":["FRS-23"]
}
Ā Response

STATUS 200Ā Returned if the Test Run Step Result is successfully updated

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the runStepId provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Update Test Run Result withĀ runId

POSTĀ /rest/synapse/latest/public/testRun/update

Ā Request

Example

{ 
	"runId":"3179", "result":"Failed", "comment":"This Test Case is failed.", "bugs":["FRS-23"]
}
Ā Response

STATUS 200Ā Returned if the Test Run Step Result is successfully updated

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the RunId provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

UpdateĀ Test Step with IDĀ 

PUTĀ /rest/synapse/latest/public/testCase/{issueKey}/updateStep

Ā Request

Example

{ 
	"ID":"67", "step":"Step 1", "expectedResult":"Result 1", "stepData":"Data 1"
}
Ā Response

STATUS 200Ā Returned if the Test Run Step Result is successfully updated

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the ID provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Delete Test Step with ID

DELETE /rest/synapse/latest/public/testCase/{issueKey}/deleteStep/{stepId}

Ā Response

STATUS 200Ā Returned if the Test Case Step is successfully updated

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the ID provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get All Child Requirements from a Requirement

GETĀ /rest/synapse/latest/public/requirement/{requirementIssueKey}/getChildren

Ā Response

STATUS 200Ā Returned if the Child Requirements are successfully retrieved from the Requirement

Example

[
  {
    "id": 15701,
    "key": "FRS-2",
    "summary": "Credit Card Validation"
  },
  {
    "id": 15704,
    "key": "FRS-5",
    "summary": "Passenger Information Validation"
  },
  {
    "id": 15702,
    "key": "FRS-3",
    "summary": "Valid Bank"
  },
  {
    "id": 15703,
    "key": "FRS-4",
    "summary": "Valid Card Owner"
  },
  {
    "id": 15705,
    "key": "FRS-6",
    "summary": "Registered User"
  },
  {
    "id": 15706,
    "key": "FRS-7",
    "summary": "Not Registered User"
  }
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the requirementIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Linked Requirements from a Test Case

GETĀ /rest/synapse/latest/public/testCase/{testCaseIssueKey}/linkedRequirements

Ā Response

STATUS 200Ā Returned if the linked Requirements are successfully retrieved from the Test Case

Example

[
  {
    "id": 15703,
    "key": "FRS-4",
    "summary": "Valid Card Owner"
  },
  {
    "id": 15701,
    "key": "FRS-2",
    "summary": "Credit Card Validation"
  },
  {
    "id": 15704,
    "key": "FRS-5",
    "summary": "Passenger Information Validation"
  }
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testCaseIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Delete Requirement Associations from a Test Case

DELETEĀ /rest/synapse/latest/public/testCase/{testCaseIssueKey}/deleteLinkedRequirements

Ā 

Ā Request

Example

{
	"requirementKeys":["FRS-2","FRS-5"]
}
Ā Response

STATUS 200Ā Returned if the Requirement Associations are successfully deleted

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the testCaseIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Get Linked Test Cases from a Requirement

GETĀ /rest/synapse/latest/public/requirement/{requirementIssueKey}/linkedTestCases

Ā Response

STATUS 200Ā Returned if the linked Test Cases are successfully retrieved from the Requirement

Example

[
  {
    "id": 15714,
    "key": "FRS-15",
    "summary": "Return error if name is not correct"
  },
  {
    "id": 15715,
    "key": "FRS-16",
    "summary": "Return  error if age is not correct"
  },
  {
    "id": 15716,
    "key": "FRS-17",
    "summary": "Return error if sex is not correct "
  }
]

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the requirementIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error

Delete Test Case Associations from a Requirement

DELETEĀ /rest/synapse/latest/public/requirement/{requirementIssueKey}/deleteLinkedTestCases

Ā Request

Example

{
	"testCaseKeys":["FRS-16","FRS-17"]
}
Ā Response

STATUS 200Ā Returned if the Test Case Associations are successfully deleted

STATUS 403 Returned if the user is not authorized perform the action or there is no valid license

STATUS 404 Returned if the requirementIssueKey provided is not found

STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error