Skip to main content

POST Add Test Case

This API creates a new test case for any Jira project

Updated over a month ago

API Endpoint


{{apiUrl}}/api/{{nodeApiVersion}}/testCase

View or Run in Postman


Headers


To authenticate the API request, you need to provide the Vansah Connect Token that is generated from the Jira workspace's Vansah configuration page.

Authorization

{{vansahConnectToken}}


Generate a Token from Vansah

Request Body


  • headline(string, required): the title of the test case

  • description(string, optional): the description of the test case

  • type(string, required): the type of test case e.g. "Regression" , "Functional"

  • priority(object, optional): the priority of a test case

    • jiraID(int,optional): jira priority id

  • assignee(object, optional):

    • jiraAccountID(int, optional): the account id of the person whom the test case is assigned to

  • label(array of strings, optional)

  • component(array of objects, optional): defines all jira component that is linked to this issue

  • jiraID(int, optional): Jira component id

  • issue(array of objects, optional): define all issues that is linked to this test case

  • key(string, optional): jira issue key

  • folder(array of objects, optional): define all test folders that this test case must be added to

  • identifier(string, required): The unique identifier of existing test folder

  • precondition(string, optional): The precondition of test case

  • preconditionHtml(string, option): The precondition html of existing test case

Example Request Body


{

"headline": "Verify Login with valid Username and Password",

"description": "This test case verifies that a user can successfully log in to the system using a valid username and password. It ensures that the application behaves as expected when provided with correct credentials.",

"precondition": " The user should have a valid username and password.\n The login page of the application should be accessible.",

"type": {

"identifier": "{{caseTypeIdentifier}}"

},

"priority": {

"jiraID": 2

},

"folder": [

{

"identifier": "{{testFolderIdentifier}}"

}

],

"issue": [

{

"key": "DEMO-1"

}

],

"component": null,

"estimatedTime": 1500

}

Example Response Body


{

"success": true,

"message": "Test Case created successfully.",

"data": {

"identifier": "460f1562-1a80-11f0-b619-a6332c493f52",

"key": "MU-C335",

"testCaseVersion": 1,

"headline": "Verify Login with valid Username and Password",

"description": "This test case verifies that a user can successfully log in to the system using a valid username and password. It ensures that the application behaves as expected when provided with correct credentials.",

"descriptionJson": "This test case verifies that a user can successfully log in to the system using a valid username and password. It ensures that the application behaves as expected when provided with correct credentials.",

"precondition": " The user should have a valid username and password.\n The login page of the application should be accessible.",

"preconditionJson": " The user should have a valid username and password.\n The login page of the application should be accessible.",

"status": 2,

"estimatedTime": 0,

"customField": {},

"testCaseStatus": null,

"type": {

"identifier": "ded69170-9127-11ef-9c82-56bd4ac65cf0",

"name": "Functional"

},

"priority": {

"identifier": "8bbb5c12-91bb-11ef-9c82-56bd4ac65cf0",

"name": "High",

"priorityJiraID": 2

},

"assignee": null,

"label": [],

"component": [],

"issue": [],

"folder": [],

"attachments": null

}

}

Did this answer your question?