Use Jira Automation to link the Test Cases in a Vansah Test Folder to newly created Jira work items. For example, link a standard set of checks whenever a new Task is created.
This flow adds Test Case links. It does not copy the Test Cases or execute them.
Before you begin
You need permission to manage automation in the Jira space. A global flow requires Jira administrator access.
Vansah must be enabled for the Jira space, and the source Test Folder must already contain the Test Cases you want to link.
Use a Vansah API token whose account can access the space and has Edit Test Case permission.
Copy the workspace’s API Connect URL and the Test Folder path.
Choose the Jira space and source folder
The example below uses the Jira space of the newly created work item to find the source folder. If you apply the flow to multiple spaces, the configured folder path must exist in each one, and the token account must have access to each space.
Start with a flow for one Jira space. Use separate flows or conditions when different spaces need different folders.
1. Create the automation flow
Open the Jira space’s Space settings > Automation.
Select Create flow > Create from scratch.
Add the Work item created trigger.
Add any conditions you need. For example, limit the work item type to Task and exclude subtasks.
The example trigger below is limited to Tasks and excludes subtasks. Change those conditions to match the work items that need your Test Cases.
For Jira’s flow setup and permission options, see Create automation flows in Jira and automation permissions.
2. Add the connection and folder variables
Add two Create variable actions before the web request.
Variable name | Value |
| Your copied API Connect URL, without a trailing slash. |
| The exact path copied from Vansah, for example |
Use the copied folder path as the value, including its trailing slash if present. The path identifies the source folder in the Jira space selected by the request.
3. Configure Send web request
Add a Send web request action after the variables.
Setting | Value |
Web request URL |
|
HTTP method |
|
Request body | Choose the custom body option and use the JSON below. |
Add these headers:
Header name | Value |
| Your Vansah API token, without a |
|
|
Paste this request body:
{
"projectKey": "{{issue.project.key}}",
"selectedAsset": {
"type": "folder",
"folderPath": "{{folderPath.jsonEncode}}"
},
"issue": [
{ "key": "{{issue.key}}" }
],
"isNewCreated": true
}Keep the smart values inside {{ }} unchanged. Jira replaces them when the flow runs.
Value | What it means |
| The Jira space key of the new work item. API fields and Jira smart values retain the word |
| The configured folder path, escaped so quotes and other characters remain valid JSON. |
| The newly created Jira work item key. |
| Identifies this as a newly created work item, allowing linking without waiting for it to appear in Jira search. |
Enable the option to wait for the web response, then save the action. Keep the token in the hidden header; do not put it in the request body or an audit-log message.
For more on the action and hidden values, see Jira automation actions. Hidden values must be entered again if you duplicate or export and import the flow.
4. Enable and test the flow
Give the flow a clear name, such as Link standard Test Cases to new Tasks.
Check its Jira space scope and conditions, then turn it on.
Create a test work item that matches the trigger and conditions.
Review the automation Audit log. Check the web request’s response status and body.
Open the new work item’s Vansah Test Management panel and confirm that the expected Test Cases are linked.
A successful Vansah response has this form:
{
"success": true,
"message": "Test Cases updated successfully.",
"data": []
}The response does not list the linked cases, so confirm the result in the work item. If the panel is hidden, follow Showing the Vansah Panel in Jira Work Items.
How later folder changes affect the flow
Each request uses the Test Cases and active versions linked to the selected folder when the flow runs. Updating the folder changes what is linked to future work items. It does not automatically synchronize work items processed earlier.
Troubleshooting
Problem | What to check |
The flow did not run | Check that it is enabled, the Jira space is in scope, and the new work item matches the trigger conditions. |
Authentication or permission error | Check token expiration, account access to the Jira space, and Edit Test Case permission. |
Asset not found | Copy the folder path again and confirm that the folder exists in the Jira space supplied by |
The response succeeds, but no cases appear | Check that the exact source folder contains linked Test Cases and inspect the work item’s Vansah panel. |
Invalid space access | Make sure the token account can access both the source folder and the destination work item. |
The web request is blocked | Check the API Connect URL and any Jira Automation domain restrictions with your Jira administrator. |
