Create a Test Run to record one execution of a Test Case against a Jira work item, Test Folder, or Test Plan iteration. Send the outcome from your automation tool, or create an Untested run before reporting individual step outcomes.
Before you begin
Create a Vansah API token with Jira access configured, and use the Vansah base URL supplied for your workspace.
The token account needs access to the Jira space and permission to execute Test Cases. Vansah applies the configured execution permission groups, or Jira’s browse permission when no groups are configured.
The Test Case must already be linked to the selected work item, folder, or plan requirement. It must not be blocked.
For a Test Plan, the plan and selected iteration must already exist.
Check whether the Jira space requires an environment, sprint, or version for Test Runs.
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. Keep your token private. Replace sample keys, UUIDs, paths, and property values with your own values.
Endpoint and authentication
POST $VANSAH_URL/api/v2/run
Header | Value |
| Your Vansah API token, sent directly without a |
|
|
|
|
Send a JSON object in the request body. This create request has no pagination or filtering parameters.
1. Choose where to record the execution
Send one asset object and one case object per request. The asset identifies the execution context.
Context | Required fields |
Jira work item |
|
Test Folder |
|
Standard Test Plan |
|
Advanced Test Plan | Use the same plan and iteration fields, plus the selected requirement. Follow Create a Test Run in an Advanced Test Plan for the requirement fields and complete examples. |
Body field | Type and requirement | How to use it |
| String · One required | The linked Test Case key, such as |
| Positive integer or object · Required for a Test Plan | Use an existing iteration number, such as |
| String · Required for a folder path; otherwise optional context | The Jira space key, such as |
| Object · Send explicitly | Use |
The API field names project.key and projectKey refer to the Jira space key.
For Test Plans, use "asset": {"type":"plannedRun","key":"DEMO-P13","iteration":1}. A top-level iteration field is not used. An iteration number must be a JSON number, such as 1, rather than "1".
When selecting a folder by path, also include "project":{"key":"DEMO"} and copy the exact path, including slashes. See Copying a Test Folder Path.
Example: Jira work item
Save this as run.json. It records a Passed execution of DEMO-C46 against DEMO-123:
{
"asset": {
"type": "issue",
"key": "DEMO-123"
},
"case": {
"key": "DEMO-C46"
},
"project": {
"key": "DEMO"
},
"result": {
"id": 2
}
}
Example: Test Folder
Use the existing folder’s UUID in asset.identifier. Replace the sample UUID and save the complete body as run.json:
{
"asset": {
"type": "folder",
"identifier": "7a2ba77a-244e-4c08-8386-6e4d0176b851"
},
"case": {
"key": "DEMO-C46"
},
"project": {
"key": "DEMO"
},
"result": {
"id": 2
}
}
Example: Standard Test Plan
This example creates an Untested run in iteration 1. Keep iteration nested inside asset:
{
"asset": {
"type": "plannedRun",
"key": "DEMO-P13",
"iteration": 1
},
"case": {
"key": "DEMO-C46"
},
"project": {
"key": "DEMO"
},
"result": {
"id": 3
}
}
2. Set the initial result
Send result explicitly. Use {"id":3} to create an Untested run before recording individual outcomes, or {"id":2} to record Passed when that result is enabled for the Jira space.
Field | Type | Behavior |
| Integer | The result ID configured in your Vansah workspace. Built-in IDs include |
| String | Alternative to the ID. Use the current result name in your workspace; matching is case-insensitive. If both ID and name are supplied, the ID takes precedence. |
Results other than the built-in Untested result must be enabled and available for the Jira space. Supplying a result also initializes the run’s applicable test logs with that result. For step-based tests, it applies to every created step log.
Although result is optional in the request schema, send it explicitly to avoid relying on the default result lookup. Use result.id: 3 when you plan to update individual steps afterward.
3. Add execution properties when needed
The properties object is optional unless the Jira space enables a property and makes it mandatory under Test Run Properties. Supply the values you want on the new run; for Test Plan executions, this request does not automatically copy the iteration’s property selections.
Body field | Type | Behavior |
| String | Environment name, such as |
| Jira version ID or string name | Select an existing Jira version in the execution context’s Jira space. Use the exact name when selecting by name. The ID takes precedence if both are supplied. |
| Jira sprint ID or string name | Select an existing accessible sprint. Name lookup uses sprints from boards in the execution context’s Jira space and matches the exact name. Prefer the ID when names are duplicated. The ID takes precedence if both are supplied. |
For example, merge this properties object into the complete request body. The fragment alone is not a create request. Replace the sample Jira IDs and name with values from your own Jira space:
{
"properties": {
"environment": {
"name": "UAT"
},
"release": {
"jiraID": "10001"
},
"sprint": {
"jiraID": 42
}
}
}
Omit an optional property to leave it unselected. A value of -1 for a sprint or version jiraID also means no selection. A name of - means no selection when no ID is used. These empty selections do not satisfy a mandatory property.
Other optional fields
Body field | Type and limits | Behavior |
| UUID string | Associate the new run with an existing, undeleted run for the same Test Case in the same Jira space. It still creates a new run. |
| String · 1–255 characters after trimming | Group related executions under your own label, such as |
| Timezone name string | Use a recognized name, such as |
Vansah captures the requirement fingerprint automatically; Test Plan executions use the selected iteration’s captured fingerprint. You do not need to send a fingerprint value.
4. Send the request
Run this command from the directory containing run.json. Add any mandatory properties to the file first:
curl --request POST \
--url "$VANSAH_URL/api/v2/run" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data-binary @run.json
Each successful POST creates a new run. If the request times out or returns a creation failure, check whether Vansah created the run before sending it again. Retry and execution-group identifiers associate runs; they do not prevent duplicate requests.
5. Read the response
A successful request returns HTTP 200. This example shows selected fields for the Passed work item or folder request with the default result name. The complete response includes additional property, execution context, and log details. The Untested plan example returns result ID 3 instead.
{
"success": true,
"message": "A new Test Run created.",
"data": {
"run": {
"identifier": "a3043da4-e54b-4bee-aa9b-556e442d49f1",
"key": 248,
"projectKey": "DEMO",
"overallResult": {
"id": 2,
"name": "PASSED"
}
}
}
}
Response field | Meaning |
| The new run’s UUID. Save it for later result and attachment requests. |
| The numeric run key within the Jira space. |
| The Jira space key. |
| The execution context. For a Test Plan, this includes |
| The built-in overall outcome. Its name can reflect workspace customization; a custom input result ID is not necessarily returned here. |
| The created logs as an array. Save log identifiers to report individual step results. A log is not guaranteed for a script with no applicable content. |
Vansah uses the active Test Case version linked to the selected execution context. If no matching active mapping is found, it falls back to the Test Case’s current version.
Record step results and attach evidence
Sending a result at creation initializes the applicable logs with the same outcome. For different outcomes or actual results per step, use the returned log identifiers in subsequent requests. Send result.id: 3 when creating the run if you want to start Untested.
Errors and troubleshooting
HTTP status | Meaning and next step |
| Invalid request, unresolved plan/iteration/requirement, unlinked or blocked Test Case, invalid result, missing mandatory property, or a creation failure. Read |
| Missing, invalid, expired, or inactive token, or Jira access is not configured for the API token. Check the token and authorization setup. |
| The account is blocked or lacks permission. Jira permission lookups can also return a denial. Review Jira space access and Vansah execution permissions. |
| The Jira permission lookup is temporarily unavailable. This response uses |
For example, an unresolved result returns HTTP 400 with this error structure:
{
"success": false,
"message": "Invalid result provided.",
"data": [],
"errorCode": 1306
}
Validation errors can instead return data.errors as an array. An errorCode is not present on every error response.
Message | What to check |
| Check the work item, folder, or plan selector. For plans, also check the existing |
| Check the Test Case key or UUID and its workspace. |
| Link the Test Case to the selected work item, folder, or plan requirement. |
| Check the blocked state in the execution context and, for Advanced Test Plans, its requirement. |
| Check the requirement selector and the account’s access. |
Environment, Sprint, or Version is required | Include the required |
| Check whether a run was created before retrying. If the failure continues, contact Vansah Support with the request and response after removing the token. |
