Automatically attach a set of Test Cases to every new Jira work item using Jira Automation and Vansah’s REST API.
What this does
This guide shows you how to build a global Jira Automation rule that fires whenever a new work item (Story, Task, Bug, etc.) is created in Jira. The rule calls a Vansah API endpoint that links a predefined set of Test Cases, taken from a Vansah Test Folder you choose to that new work item.
Example
Every time someone creates a User Story, your 5 standard “definition of done” Test Cases get linked to it automatically - no manual linking required.
Before you start - what you’ll need
# | You need | Where to get it |
1 | Jira Administrator or Automation admin rights | Your Jira admin grants this |
2 | A Vansah Test Folder path containing the Test Cases you want linked | From Vansah board |
3 | The exact folder path of that Test Folder | |
4 | A Vansah API Token | |
5 | Your Vansah API Connect URL |
A Vansah API Token gives access to your Vansah data. Treat it like a password. Never share it, never paste it into a public page, and never email it. Each person or team should generate their own.
Step 1 - Decide your Test Folder and copy its path
The rule links Test Cases from one Test Folder. Whatever Test Cases sit in that folder are the ones that get attached to each new work item. Getting the Folder Path of a Test Folder | Vansah Help Center
Step 2 - Create your Vansah API Token
This token lets Jira Automation talk to Vansah on your behalf. Create Vansah API Token | Vansah Help Center
Step 3 - Create the global Automation flow
Add the Trigger
Add a Condition (so it ignores subtasks)
This stops the rule from firing on subtasks, which usually don’t need their own Test Cases.
Click Add Step → Add condition → Issue fields condition (or use a Smart value condition).
Configure it as:
Field / first value:
{{issue.issueType.subtask}}Condition:
equalsValue:
false
Click Save.
💡 Optional - limit to specific issue types: If you only want this for User Stories, add an Issue type condition here set to Issue Type equals Story instead of (or in addition to) the subtask condition.
Step 4 - Add 3 variables (your URL, API version and Test Folder Path)
Using variables keeps your settings tidy and easy to update later.
Click New component → Add action → Create variable.
Variable name:
apiUrlSmart value: your Vansah API Connect URL from Step 2 - for example
https://prodau.vansah.comClick Save.
Add another Create variable action:
Variable name:
nodeApiVersionSmart value:
v2Click Save.
Add another Create variable action:
Variable name:
folderPathSmart value:
all standard work item test cases/Click Save.
Step 5 - Add the “Send web request” action
This is the action that actually calls Vansah and links the Test Cases.
Click New component → Add action → Send web request.
Fill in the fields exactly as below:
Field | Value |
Web request URL |
|
HTTP method |
|
Web request body |
|
Under Headers, click Add header:
Name:
AuthorizationValue: paste your Vansah API Token from Step 2
In the Custom data box, paste the following and edit the highlighted part:
What to change in the body:
folderPath→ replaceall standard work item test cases/with your folder path from Step 1 (keep the trailing/).Leave
{{project.key}}and{{issue.key}}exactly as they are - Jira fills these in automatically with the new work item’s details.Tick Delay rule execution until we’ve received a response for this web request (recommended, so you can see success/failure in the audit log).
{ "projectKey": "{{project.key}}", "selectedAsset": { "type": "folder", "folderPath": "{{folderPath}}" }, "issue": [ { "key": "{{issue.key}}" } ] }
Click on Save
Step 6 - Name, scope, and turn on the rule
At the top, give the rule a clear name, e.g. “Auto-link standard Test Cases to new work items.”
Set the rule scope:
For all projects, choose Global (this is what makes it fire everywhere). Global rules require Jira admin permission.
For one project, set the scope to just that project.
Click Turn it on / Publish rule.
Step 7 - Test it
Create a new test work item (e.g. a Story) in a project covered by the rule.
Open that work item and scroll to the Vansah Test Management section (or the Vansah panel).
You should see your standard Test Cases now linked to it.
To confirm what happened behind the scenes, open the rule and check the Audit log - a successful run shows a green Success status.
Troubleshooting
Symptom | Likely cause | Fix |
Audit log shows 401 / Unauthorized | Token is wrong, expired, or revoked | Generate a fresh token (Step 2) and update the Authorization header |
Audit log shows 404 / Not found | Wrong API URL or version | Re-check the API Connect URL shown on your token screen; confirm the version is |
Rule runs but no Test Cases appear |
| Path is case-sensitive and must end with |
Rule didn’t fire at all | Created a subtask, or scope too narrow | Subtasks are excluded by the condition; check the rule scope covers the project |
Same Test Cases linked twice | Rule ran more than once | Vansah typically won’t duplicate an existing link; verify in the work item’s Vansah panel |
Reference: How to create a Vansah API Token · Vansah API Connect URL ·
