Test Case Resource

Below are the list of REST APIs we developed related to test case

Create New Test Case with Test Steps without Test Suite

POST /rest/testray/latest/public/testCase/create/createTestCase

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/create/createTestCase

REQUEST body

JSON
{
  "fields": 
  {
    "project":
      {"key": "TAT"},
    "summary": "[API] Test Case 1 without Test Suite information",
    "description": "This Test Case Is Created from REST API, [API] Test Case 1",
    "issueType":
      {"name": "Test Case"}
  },
  "testCaseSteps":
  [
    {"step":"It is the first Test Step", "stepData": "It is Test Data for the first Test Step", "expectedResult":"It is the Expected Result for the first Test Step"},
    {"step":"It is the second Test Step", "stepData": "It is Test Data for the second Test Step", "expectedResult":"It is the Expected Result for the second Test Step"}
  ]
}
Create New Test Case with Test Steps with Test Suite

POST /rest/testray/latest/public/testSuite/createTestCase

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testSuite/createTestCase

REQUEST body

JSON
{
  "fields": 
  {
    "project":
     {"key": "TAT"},
    "summary": "[API] Test Case 2 with Test Suite information",
    "description": "This Test Case Is Created from REST API, [API] Test Case 1",
    "issueType":
     {"name": "Test Case"}
  },
  "testCaseSteps":
  [
    {"step": "It is the first Test Step", "stepData": "It is Test Data for the first Test Step", "expectedResult": "It is the Expected Result for the first Test Step"},
    {"step": "It is the second Test Step", "stepData": "It is Test Data for the second Test Step", "expectedResult": "It is the Expected Result for the second Test Step"},
    {"step": "It is the third Test Step", "stepData": "It is Test Data for the third Test Step", "expectedResult": "It is the Expected Result for the third Test Step"}
  ],
   "linkToTestSuite":
  {
    "testSuitePath": "TAT Test Suite 1/API Sub Suite 1/API Sub Suite 1-1",
      "projectKey": "TAT"
  }
}
Add Test Steps to a Test Case

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

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-1/addSteps

REQUEST body

JSON
[
    {   "step":"1st additional test step added via REST API",
        "stepData": "1st additional test data added via REST API",
        "expectedResult":"1st additional expected result added via REST API" 
    },
    {   "step":"2nd additional test step added via REST API",
        "stepData": "",
        "expectedResult":"2nd additional expected result added via REST API" 
    }
]
Get Test Steps from a Test Case

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

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-1/steps

REQUEST body NULL

Update a Test Step from Test Case with Step ID

Put /rest/testray/latest/public/testCase/{testCaseIssueKey}/updateStep

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-1/updateStep

REQUEST body

JSON
{
    "ID":"112233", 
    "step":"Update Step XXX", 
    "stepData":"Update Test Data ZZZ",
    "expectedResult":"Update Expected Result YYY" 
}
Update a Test Step from Test Case with Step sequenceNumber

Put /rest/testray/latest/public/testCase/{testCaseIssueKey}/updateStep

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-1/updateStep

REQUEST body

JSON
{ 
    "sequenceNumber":"3", 
    "step":"Step 3 Updated", 
    "stepData":"Test Data 3 Updated",
    "expectedResult":"Expected Result 3 Updated" 
}
Delete a Test Step from Test Case with Step ID

Delete /rest/testray/latest/public/testCase/{testCaseIssueKey}/deleteStep/{testStepID}

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-1/deleteStep/133242

REQUEST body NULL

Create Ad Hoc Test Run from a Test Case

Put /rest/testray/latest/public/testRun/adhoc/create/{testCaseIssueKey}

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testRun/adhoc/create/TAT-1

REQUEST body NULL

Get Ad Hoc Test Run Details from a Test Case

get /rest/testray/latest/public/testRun/adhoc/getTestRuns/{testCaseIssueKey}

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testRun/adhoc/getTestRuns/TAT-1

REQUEST body NULL

Get All Linked Requirements from a Test Case

get /rest/testray/latest/public/testCase/{testCaseIssueKey}/linkedRequirements

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-110/linkedRequirements

REQUEST body NULL

Delete Requirement Associations from a Test Case

delete /rest/testray/latest/public/testCase/{testCaseIssueKey}/deleteLinkedRequirements

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-110/deleteLinkedRequirements

REQUEST body

JSON
{
    "requirementKeys":["TAT-100"]
}
Get Defects Reported from a Test Case

get /rest/testray/latest/public/testCase/{testCaseIssueKey}/getDefects

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-110/getDefects

REQUEST body NULL

Get Test Suite Information from a Test Case

get /rest/testray/latest/public/testCase/{testCaseIssueKey}/linkedTestSuites

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-110/linkedTestSuites

REQUEST body NULL

Get Test Plan Information from a Test Case

get /rest/testray/latest/public/testCase/{testCaseIssueKey}/linkedTestPlans

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testCase/TAT-100/linkedTestPlans

REQUEST body NULL

Link a Test Case to a Test Suite

POST /rest/testray/latest/public/testSuite/linkTestCase

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testSuite/linkTestCase

REQUEST body

JSON
{
	"testCaseKeys": ["TAT-1", "TAT-2"],
	"testSuitePath": "TAT Test Suite 1/API Sub Suite 1/API Sub Suite 1-1",
	"projectKey": "TAT"
}
Delete Test Suite Information from a Test Case

delete /rest/testray/latest/public/testSuite/{projectKey}/removeTestSuiteMember

SAMPLE http://testray.goldfingerholdings.onl/rest/testray/latest/public/testSuite/TAT/removeTestSuiteMember

REQUEST body

JSON
{
    "testSuitePath": "TAT Test Suite 1/API Sub Suite 1/API Sub Suite 1-1",
    "testCaseKeys": ["TAT-1", "TAT-2"]
}