How to import Test Cases


Basic flow

  1. Prepare the necessary data and authorize the session | Rest API | General information

  2. Make a request: POST /import-test-cases?jwt=<YOUR_JWT>

    • Request body data model:

    type ImportData = { projectId: number | string; testCases: Array<TestCase>; }; type TestCase = { name: string; testSteps: Array<TestStep>; [additionalField: string]?: {}; // eg. description, priority }; type TestStep = { step: string; data: string; result: string; };

     

    • Request response data model:

    type ImportResult = { success: Array<{ testCaseKey: string; name: string; }>; errors: Array<{ name: string; details: { errorMessages: Array<string>; errors: Record<FieldName, string>; }; }>; };

Script

Example script is written in Deno.

 

.env

username=<your email> password=<your Jira token> // you can get the token here: https://id.atlassian.com/manage-profile/security/api-tokens jira_instance_name=<your Jira instance name> project_id=<your project id>

 

index.ts