Create a Vansah Test Case in a Jira space using this API. You can include the description, preconditions, labels, requirement links, and a Test Script in the same request.
Before you begin
Create a Vansah API token and use the Vansah URL supplied for your workspace.
The token account must be able to access the Jira space and have permission to create Test Cases in Vansah.
Find the UUID of an existing Test Case type in that space using List Test Case Types.
For optional links, have the Jira work item keys and Test Folder UUIDs you want to use.
The examples use Bash and cURL. Set VANSAH_URL to your Vansah base URL without a trailing slash and VANSAH_TOKEN to your API token. Replace the example space key, UUIDs, and other values with your own. Keep your token private.
Endpoint and headers
POST /api/v2/testCase
Header | Value |
| Your Vansah API token, without a |
|
|
|
|
1. Provide the Test Case details
Field | What to send |
| The Jira space key, for example |
| Required title, 1–800 characters after trimming. |
| Required UUID of an active Test Case type. Supply a |
| Optional text explaining what the case verifies. If omitted, the headline is used as the description. |
| Optional text describing the starting conditions. |
| Optional rich-text documents in Atlassian Document Format (ADF). Each takes precedence over the corresponding text field. |
| Optional Jira priority ID. Look up the ID with List Test Case Priorities. |
| Optional Jira account ID as a string. Use the account ID, rather than an email address or display name. |
| Optional array of label names, such as |
| Optional array of objects containing Jira component IDs, such as |
| Optional array of Jira work item objects, such as |
| Optional array of existing Test Folder objects, such as |
Omit optional objects you do not need. If you supply priority or assignee, include its nested ID field.
Minimal request
This creates the Test Case without an inline script:
{
"project": {
"key": "DEMO"
},
"headline": "Sign in with a valid account",
"type": {
"identifier": "446b5362-a167-41ef-99bc-4a527ec72f78"
}
}
2. Add a Test Script
Include scriptType to create the script with the Test Case. Use the exact values below:
| Script fields |
| A nonempty |
| Use |
| Use |
| Use |
For rich-text step content, use stepDataAdf, resultDataAdf, and testDataAdf instead of the corresponding text fields. Rich-text documents are limited to 2,000,000 serialized bytes, 10,000 nodes, and 200,000 text characters; saved-field capacity can impose a smaller limit.
Example: Test Case with two steps
Save this as test-case.json. Replace the type UUID, folder UUID, Jira work item key, and priority ID with values from your own Jira space:
{
"project": {
"key": "DEMO"
},
"headline": "Sign in with a valid account",
"type": {
"identifier": "446b5362-a167-41ef-99bc-4a527ec72f78"
},
"description": "Verify that an active user can sign in and access their account.",
"precondition": "An active test account exists. The sign-in page is available.",
"priority": {
"jiraID": 2
},
"label": [
"Smoke"
],
"folder": [
{
"identifier": "675ab256-06c5-4f09-bf96-a6c5c347d057"
}
],
"issue": [
{
"key": "DEMO-123"
}
],
"scriptType": "multistep",
"steps": [
{
"position": 1,
"step": "Open the sign-in page.",
"expectedResult": "The sign-in form appears."
},
{
"position": 2,
"step": "Enter valid credentials and select Sign in.",
"testData": "Use the test account configured for this environment.",
"expectedResult": "The account page appears."
}
]
}
Example: BDD script
Use the same Test Case fields with scriptType: "bdd" and bddData:
{
"project": {
"key": "DEMO"
},
"headline": "Sign in with a valid account using BDD",
"type": {
"identifier": "446b5362-a167-41ef-99bc-4a527ec72f78"
},
"scriptType": "bdd",
"bddData": "Feature: Account access\n Scenario: Valid sign-in\n Given an active user is on the sign-in page\n When the user signs in with valid credentials\n Then the account page is displayed"
}
Example: Plain Text script
{
"project": {
"key": "DEMO"
},
"headline": "Sign in with a valid account",
"type": {
"identifier": "446b5362-a167-41ef-99bc-4a527ec72f78"
},
"scriptType": "plainText",
"plainTextDataAdf": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Sign in with an active test account and confirm the account page appears."
}
]
}
]
}
}
3. Create the Test Case
curl --request POST \
--url "$VANSAH_URL/api/v2/testCase" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data-binary @test-case.json
Each successful request creates a new Test Case. If the request times out or fails after processing starts, check Vansah before resending it to avoid duplicates.
4. Save the Test Case identifier
Example successful response showing selected fields and one returned step:
{
"success": true,
"message": "Test Case created successfully.",
"data": {
"identifier": "460f1562-1a80-41f0-b619-a6332c493f52",
"key": "DEMO-C335",
"testCaseVersion": 1,
"headline": "Sign in with a valid account",
"type": {
"identifier": "446b5362-a167-41ef-99bc-4a527ec72f78",
"name": "Functional"
},
"script": {
"type": "multistep",
"data": [
{
"identifier": "15df09b4-177c-447f-934d-255b7125cc67",
"position": 1,
"stepOrder": 1,
"plainStep": "Open the sign-in page.",
"plainExpectedResult": "The sign-in form appears."
}
]
}
}
}
Response field | Meaning |
| The new Test Case UUID. Save it for later API calls. |
| The readable Test Case key, such as |
| The created version, |
| The saved Test Case type. |
| The saved rich-text description and preconditions. |
| The created script when you supplied |
Open the Test Case in Vansah to confirm the script and requirement links. You can also find it by key with List Test Cases (API).
Other creation details
Estimated time: This create request does not save
estimatedTime. Set it after creation in Vansah or with the Test Case update API.Script evidence: Step objects can include an
attachmentsarray. For Plain Text, BDD, or Automation scripts, use a top-levelattachmentsarray. Each attachment needs aname, an extension, and one source: Base64filedata or an HTTPSurl. These attach evidence to the script, rather than recording a Test Run result.Advanced Test Plan links: The request also accepts
testPlanAssetIdentifierfor a plan requirement andeprIdentifierfor an existing iteration when creating a case in a plan context. Use identifiers from the intended plan and requirement.
Troubleshooting
Message or issue | What to check |
| Inspect |
| Use an active type UUID returned for the intended Jira space. |
| Make |
| For |
| Give every step a different positive integer |
| Check the Jira priority ID or account ID. |
| Check the Jira work item keys, folder UUIDs, workspace, and account access. |
Authentication or permission error | Check the token and permission to create Test Cases. New labels also need permission to add labels. |
| Check whether the case or its links were created before retrying. If the problem continues, contact Vansah Support with the request and response, without your token. |
You can also view this request in the Vansah API collection in Postman.
