Skip to main content

Auto-Link Vansah Test Cases from a Test Folder to New Jira Work Items

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

  1. In Jira, go to ⚙ Settings → System → Global Automation

  2. Click on Create Flow and name it.

    image-20260525-061059.png

Add the Trigger

  1. Choose Work Item created as the trigger.

    image-20260525-061217.png
  2. Click Save.

Add a Condition (so it ignores subtasks)

This stops the rule from firing on subtasks, which usually don’t need their own Test Cases.

  1. Click Add Step → Add condition → Issue fields condition (or use a Smart value condition).

  2. Configure it as:

    • Field / first value: {{issue.issueType.subtask}}

    • Condition: equals

    • Value: false

  3. 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.

  1. Click New component → Add action → Create variable.

  2. Variable name: apiUrl

  3. Smart value: your Vansah API Connect URL from Step 2 - for example https://prodau.vansah.com

  4. Click Save.

  5. Add another Create variable action:

    • Variable name: nodeApiVersion

    • Smart value: v2

    • Click Save.

  6. Add another Create variable action:

    • Variable name: folderPath

    • Smart 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.

  1. Click New component → Add action → Send web request.

  2. Fill in the fields exactly as below:

Field

Value

Web request URL

{{apiUrl}}/api/{{nodeApiVersion}}/testCases/bulk

HTTP method

PUT

Web request body

Custom data

  1. Under Headers, click Add header:

  2. Name: Authorization

  3. Value: paste your Vansah API Token from Step 2

  4. In the Custom data box, paste the following and edit the highlighted part:

    • What to change in the body:

      1. folderPath → replace all standard work item test cases/ with your folder path from Step 1 (keep the trailing /).

      2. Leave {{project.key}} and {{issue.key}} exactly as they are - Jira fills these in automatically with the new work item’s details.

      3. 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}}" } ] }

  5. Click on Save


Step 6 - Name, scope, and turn on the rule

  1. At the top, give the rule a clear name, e.g. “Auto-link standard Test Cases to new work items.”

  2. 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.

  3. Click Turn it on / Publish rule.


Step 7 - Test it

  1. Create a new test work item (e.g. a Story) in a project covered by the rule.

  2. Open that work item and scroll to the Vansah Test Management section (or the Vansah panel).

  3. You should see your standard Test Cases now linked to it.

  4. 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 v2

Rule runs but no Test Cases appear

folderPath doesn’t match

Path is case-sensitive and must end with /. Copy it exactly as it appears in Vansah

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

Did this answer your question?