@rbaileysr/zephyr-managed-api 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,29 +44,29 @@ const apiEU = createZephyrApi(
44
44
  ## Supported API calls
45
45
 
46
46
  - [fetch](https://docs.adaptavist.com/src/managed-apis/managed-api-abstractions)
47
- - Project
47
+ - ### Project
48
48
  - [listProjects](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Projects/operation/listProjects)
49
49
  - [getProject](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Projects/operation/getProject)
50
- - Status
50
+ - ### Status
51
51
  - [listStatuses](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/listStatuses)
52
52
  - [getStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/getStatus)
53
53
  - [createStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/createStatus)
54
54
  - [updateStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/updateStatus)
55
- - Priority
55
+ - ### Priority
56
56
  - [listPriorities](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/listPriorities)
57
57
  - [getPriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/getPriority)
58
58
  - [createPriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/createPriority)
59
59
  - [updatePriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/updatePriority)
60
- - Environment
60
+ - ### Environment
61
61
  - [listEnvironments](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/listEnvironments)
62
62
  - [getEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/getEnvironment)
63
63
  - [createEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/createEnvironment)
64
64
  - [updateEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/updateEnvironment)
65
- - Folder
65
+ - ### Folder
66
66
  - [listFolders](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/listFolders)
67
67
  - [getFolder](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/getFolder)
68
68
  - [createFolder](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/createFolder)
69
- - TestCase
69
+ - ### TestCase
70
70
  - [listTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/listTestCases)
71
71
  - [listTestCasesCursorPaginated](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/listTestCasesCursorPaginated)
72
72
  - [getTestCase](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/getTestCase)
@@ -81,7 +81,7 @@ const apiEU = createZephyrApi(
81
81
  - [createTestCaseTestScript](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/createTestCaseTestScript)
82
82
  - [getTestCaseTestSteps](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/getTestCaseTestSteps)
83
83
  - [createTestCaseTestSteps](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/createTestCaseTestSteps)
84
- - TestCycle
84
+ - ### TestCycle
85
85
  - [listTestCycles](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/listTestCycles)
86
86
  - [getTestCycle](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/getTestCycle)
87
87
  - [createTestCycle](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycle)
@@ -89,14 +89,14 @@ const apiEU = createZephyrApi(
89
89
  - [getTestCycleLinks](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/getTestCycleLinks)
90
90
  - [createTestCycleIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycleIssueLink)
91
91
  - [createTestCycleWebLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycleWebLink)
92
- - TestPlan
92
+ - ### TestPlan
93
93
  - [listTestPlans](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/listTestPlans)
94
94
  - [getTestPlan](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/getTestPlan)
95
95
  - [createTestPlan](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlan)
96
96
  - [createTestPlanIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanIssueLink)
97
97
  - [createTestPlanWebLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanWebLink)
98
98
  - [createTestPlanTestCycleLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanTestCycleLink)
99
- - TestExecution
99
+ - ### TestExecution
100
100
  - [listTestExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutions)
101
101
  - [listTestExecutionsNextgen](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutionsNextgen)
102
102
  - [getTestExecution](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/getTestExecution)
@@ -107,59 +107,58 @@ const apiEU = createZephyrApi(
107
107
  - [syncTestExecutionScript](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/syncTestExecutionScript)
108
108
  - [listTestExecutionLinks](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutionLinks)
109
109
  - [createTestExecutionIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecutionIssueLink)
110
- - Link
110
+ - ### Link
111
111
  - [deleteLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Links/operation/deleteLink)
112
- - IssueLink
112
+ - ### IssueLink
113
113
  - [getIssueLinkTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestCases)
114
114
  - [getIssueLinkTestCycles](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestCycles)
115
115
  - [getIssueLinkTestPlans](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestPlans)
116
116
  - [getIssueLinkExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkExecutions)
117
- - Automation
117
+ - ### Automation
118
118
  - [createCustomExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCustomExecutions)
119
119
  - [createCucumberExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCucumberExecutions)
120
120
  - [createJUnitExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createJUnitExecutions)
121
121
  - [retrieveBDDTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/retrieveBDDTestCases)
122
- - Private ⚠️
123
- > **⚠️ WARNING: Private API Methods**
124
- >
125
- > The following methods use Zephyr's private/unofficial API endpoints that are:
126
- > - **Not officially supported** by SmartBear
127
- > - **Not part of the public API documentation**
128
- > - **Subject to change at any time** without notice
129
- > - **Not covered by Standard Support**
130
- >
131
- > Use these methods at your own risk. They may break with future Zephyr updates.
132
-
133
- - Authentication
134
- - **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
135
- - Comments
136
- - **Test Case**: `getTestCaseComments`, `createTestCaseComment`
137
- - **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
138
- - **Test Plan**: `getTestPlanComments`, `createTestPlanComment`
139
- - Config
140
- - **CustomFields**: `createCustomField`, `getCustomFields`
141
- - **Labels**: `getLabels`, `createLabel`
142
- - **Iterations**: `getIterations`, `createIteration`
143
- - **DataSets**: `getDataSets`, `createDataSet`, `updateDataSet`
144
- - **archiveConfig** - Archive a config item (Environment, Iteration, or Status)
145
- - **unarchiveConfig** - Unarchive a config item (Environment, Iteration, or Status)
146
- - Versions
147
- - **createTestCaseVersion** - Create a new test case version
148
- - Attachments
149
- - **Test Case**: `getTestCaseAttachments`, `downloadAttachment`, `createTestCaseAttachment`
150
- - **Test Step**: `getTestStepAttachments`, `downloadTestStepAttachment`, `createTestStepAttachment`
151
- - **Test Cycle**: `getTestCycleAttachments`, `downloadTestCycleAttachment`, `createTestCycleAttachment`
152
- - **Test Plan**: `getTestPlanAttachments`, `downloadTestPlanAttachment`, `createTestPlanAttachment`
153
- - **Test Execution**: `getTestExecutionAttachments`, `downloadTestExecutionAttachment`, `createTestExecutionAttachment`
154
- - **Test Execution Step**: `getTestExecutionStepAttachments`, `downloadTestExecutionStepAttachment`, `createTestExecutionStepAttachment`
155
- - VersionControl
156
- - **Test Case (version-specific)**: `getTestCaseIssueLinks`, `getTestCaseWebLinks`, `getTestCaseTestScript`, `getTestCaseTestSteps`
157
- - **Test Execution Step**: `getTestExecutionStepIssueLinks`, `createTestExecutionStepIssueLink`
158
- - ExtendedData (supplements public API with extended data: iterations and versions)
159
- - **Test Cycle**: `getTestCycleIteration`, `updateTestCycleIteration`
160
- - **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
161
- - TestCaseArchiving (access archived test cases and archiving operations)
162
- - **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
122
+ - **Private** ⚠️
123
+ > **⚠️ WARNING: Private API Methods**
124
+ >
125
+ > The following methods use Zephyr's private/unofficial API endpoints that are:
126
+ > - **Not officially supported** by SmartBear
127
+ > - **Not part of the public API documentation**
128
+ > - **Subject to change at any time** without notice
129
+ > - **Not covered by Standard Support**
130
+ >
131
+ > Use these methods at your own risk. They may break with future Zephyr updates.
132
+ - ### Authentication
133
+ - **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
134
+ - ### Comments
135
+ - **Test Case**: `getTestCaseComments`, `createTestCaseComment`
136
+ - **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
137
+ - **Test Plan**: `getTestPlanComments`, `createTestPlanComment`
138
+ - ### Config
139
+ - **CustomFields**: `createCustomField`, `getCustomFields`
140
+ - **Labels**: `getLabels`, `createLabel`
141
+ - **Iterations**: `getIterations`, `createIteration`
142
+ - **DataSets**: `getDataSets`, `createDataSet`, `updateDataSet`
143
+ - **archiveConfig** - Archive a config item (Environment, Iteration, or Status)
144
+ - **unarchiveConfig** - Unarchive a config item (Environment, Iteration, or Status)
145
+ - ### Versions
146
+ - **createTestCaseVersion** - Create a new test case version
147
+ - ### Attachments
148
+ - **Test Case**: `getTestCaseAttachments`, `downloadAttachment`, `createTestCaseAttachment`
149
+ - **Test Step**: `getTestStepAttachments`, `downloadTestStepAttachment`, `createTestStepAttachment`
150
+ - **Test Cycle**: `getTestCycleAttachments`, `downloadTestCycleAttachment`, `createTestCycleAttachment`
151
+ - **Test Plan**: `getTestPlanAttachments`, `downloadTestPlanAttachment`, `createTestPlanAttachment`
152
+ - **Test Execution**: `getTestExecutionAttachments`, `downloadTestExecutionAttachment`, `createTestExecutionAttachment`
153
+ - **Test Execution Step**: `getTestExecutionStepAttachments`, `downloadTestExecutionStepAttachment`, `createTestExecutionStepAttachment`
154
+ - ### VersionControl
155
+ - **Test Case (version-specific)**: `getTestCaseIssueLinks`, `getTestCaseWebLinks`, `getTestCaseTestScript`, `getTestCaseTestSteps`
156
+ - **Test Execution Step**: `getTestExecutionStepIssueLinks`, `createTestExecutionStepIssueLink`
157
+ - ### ExtendedData (supplements public API with extended data: iterations and versions)
158
+ - **Test Cycle**: `getTestCycleIteration`, `updateTestCycleIteration`
159
+ - **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
160
+ - ### TestCaseArchiving (access archived test cases and archiving operations)
161
+ - **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
163
162
 
164
163
  ## Private API Authentication
165
164
 
@@ -186,133 +185,69 @@ const credentials = {
186
185
  const contextJwt = await api.Private.Authentication.getContextJwt(credentials);
187
186
  ```
188
187
 
189
- ### Example: Create Custom Field
188
+ ### Example: Config Operations
190
189
 
191
190
  ```typescript
192
- // Create a custom field for test cases
191
+ // Create custom field
193
192
  const customField = await api.Private.Config.CustomFields.createCustomField(
194
- credentials,
195
- 'TEST_CASE',
196
- {
193
+ credentials, 'TEST_CASE', {
197
194
  projectId: 10017,
198
195
  name: 'Build Number',
199
196
  type: 'SINGLE_LINE_TEXT',
200
- required: false,
201
- index: 4,
202
- category: 'TEST_CASE',
203
- archived: false
197
+ required: false
204
198
  }
205
199
  );
206
- ```
207
-
208
- ### Example: Create Label
209
200
 
210
- ```typescript
211
- // Create a new label
201
+ // Create label
212
202
  await api.Private.Config.Labels.createLabel(credentials, {
213
203
  projectId: 10233,
214
204
  name: 'automated'
215
205
  });
216
206
 
217
- // Get all labels
218
- const labels = await api.Private.Config.Labels.getLabels(credentials, {
219
- projectId: 10233
220
- });
221
- ```
222
-
223
- ### Example: Create Iteration
224
-
225
- ```typescript
226
- // Create a new iteration
207
+ // Create iteration
227
208
  const iteration = await api.Private.Config.Iterations.createIteration(credentials, {
228
209
  projectId: 10233,
229
210
  name: 'Sprint 1',
230
211
  description: 'First sprint of Q1'
231
212
  });
232
213
 
233
- // Get all iterations
234
- const iterations = await api.Private.Config.Iterations.getIterations(credentials, {
235
- projectId: 10233
236
- });
237
- ```
238
-
239
- ### Example: Create and Update Data Set
240
-
241
- ```typescript
242
- // Create a new data set (empty)
214
+ // Create and update data set
243
215
  const dataSet = await api.Private.Config.DataSets.createDataSet(credentials, {
244
216
  projectId: 10233,
245
217
  name: 'Environment'
246
218
  });
247
-
248
- // Add items/options to the data set
249
- const updatedDataSet = await api.Private.Config.DataSets.updateDataSet(credentials, {
219
+ await api.Private.Config.DataSets.updateDataSet(credentials, {
250
220
  id: dataSet.id,
251
- name: 'Environment',
252
221
  projectId: 10233,
253
222
  items: [
254
223
  { name: 'Production', index: 0, archived: false },
255
- { name: 'Staging', index: 1, archived: false },
256
- { name: 'Development', index: 2, archived: false }
224
+ { name: 'Staging', index: 1, archived: false }
257
225
  ]
258
226
  });
259
-
260
- // Get all data sets
261
- const dataSets = await api.Private.Config.DataSets.getDataSets(credentials, {
262
- projectId: 10233
263
- });
264
227
  ```
265
228
 
266
229
  ### Example: Archive and Unarchive Config Items
267
230
 
268
231
  ```typescript
269
- // Archive an environment
270
- const archivedEnv = await api.Private.Config.archiveConfig(credentials, {
232
+ // Archive an environment or iteration
233
+ await api.Private.Config.archiveConfig(credentials, {
271
234
  type: 'Environment',
272
235
  id: 10873400,
273
236
  projectId: 10233
274
237
  });
275
238
 
276
- // Unarchive an iteration
277
- const unarchivedIteration = await api.Private.Config.unarchiveConfig(credentials, {
278
- type: 'Iteration',
279
- id: 10909775,
280
- projectId: 10233
281
- });
282
-
283
- // Archive a test case status
284
- const archivedTestCaseStatus = await api.Private.Config.archiveConfig(credentials, {
239
+ // Archive statuses (supports: TestCaseStatus, TestPlanStatus, TestCycleStatus, TestExecutionStatus)
240
+ await api.Private.Config.archiveConfig(credentials, {
285
241
  type: 'TestCaseStatus',
286
242
  id: 10952238,
287
243
  projectId: 10313
288
244
  });
289
245
 
290
- // Archive a test plan status
291
- const archivedTestPlanStatus = await api.Private.Config.archiveConfig(credentials, {
292
- type: 'TestPlanStatus',
293
- id: 10952241,
294
- projectId: 10313
295
- });
296
-
297
- // Archive a test cycle status
298
- const archivedTestCycleStatus = await api.Private.Config.archiveConfig(credentials, {
299
- type: 'TestCycleStatus',
300
- id: 10952244,
301
- projectId: 10313
302
- });
303
-
304
- // Archive a test execution status
305
- const archivedTestExecutionStatus = await api.Private.Config.archiveConfig(credentials, {
306
- type: 'TestExecutionStatus',
307
- id: 10952247,
308
- projectId: 10313
309
- });
310
-
311
- // Unarchive any status (same types supported)
312
- const unarchivedStatus = await api.Private.Config.unarchiveConfig(credentials, {
313
- type: 'TestCaseStatus',
314
- id: 10952238,
315
- projectId: 10313
246
+ // Unarchive any config item (same types supported)
247
+ await api.Private.Config.unarchiveConfig(credentials, {
248
+ type: 'Iteration',
249
+ id: 10909775,
250
+ projectId: 10233
316
251
  });
317
252
  ```
318
253
 
@@ -347,46 +282,30 @@ const attachment = await api.Private.Attachments.createTestCaseAttachment(
347
282
  );
348
283
  ```
349
284
 
350
- ### Example: Get Version-Specific Data
285
+ ### Example: Version-Specific Data
351
286
 
352
287
  ```typescript
353
- // Get issue links for current version
288
+ // Get version-specific data for test cases (version parameter is optional, defaults to latest)
354
289
  const issueLinks = await api.Private.VersionControl.getTestCaseIssueLinks(credentials, {
355
290
  testCaseKey: 'PROJ-T1',
356
- projectId: 10233
357
- });
358
-
359
- // Get web links for version 2 (previous version)
360
- const webLinks = await api.Private.VersionControl.getTestCaseWebLinks(credentials, {
361
- testCaseKey: 'PROJ-T1',
362
- projectId: 10233,
363
- version: 2
291
+ projectId: 10233,
292
+ version: 2 // Get links for version 2
364
293
  });
365
294
 
366
- // Get test script for version 3
367
295
  const testScript = await api.Private.VersionControl.getTestCaseTestScript(credentials, {
368
- testCaseKey: 'PROJ-T1',
369
- projectId: 10233,
370
- version: 3
371
- });
372
-
373
- // Get test steps for version 4 (current version, if there are 4 versions total)
374
- const testSteps = await api.Private.VersionControl.getTestCaseTestSteps(credentials, {
375
296
  testCaseKey: 'PROJ-T1',
376
297
  projectId: 10233,
377
- version: 4
298
+ version: 3
378
299
  });
379
300
 
380
- // Get issue links for a test execution step (useful for migration)
381
- const stepIssueLinks = await api.Private.VersionControl.getTestExecutionStepIssueLinks(credentials, {
301
+ // Test execution step issue links
302
+ const stepLinks = await api.Private.VersionControl.getTestExecutionStepIssueLinks(credentials, {
382
303
  testExecutionKey: 'PROJ-E1',
383
304
  stepIndex: 0,
384
305
  projectId: 10233
385
306
  });
386
- // Returns: [{ id: 169099471, issueId: '66019', type: 'BLOCKS' }, ...]
387
307
 
388
- // Create an issue link for a test execution step
389
- const stepLink = await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
308
+ await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
390
309
  testExecutionKey: 'PROJ-E1',
391
310
  stepIndex: 0,
392
311
  issueId: 66019,
@@ -395,163 +314,83 @@ const stepLink = await api.Private.VersionControl.createTestExecutionStepIssueLi
395
314
  });
396
315
  ```
397
316
 
398
- ### Example: Get and Set Extended Data (Supplements Public API)
317
+ ### Example: Extended Data (Supplements Public API)
399
318
 
400
- The public API does not support getting or setting iterations for Test Cycles and Test Executions, or Jira version IDs (release versions) for Test Executions. Use the `ExtendedData` sub-group to supplement public API calls with this additional data.
319
+ The public API does not support iterations for Test Cycles/Executions or Jira version IDs for Test Executions. Use `ExtendedData` to supplement public API calls.
401
320
 
402
321
  ```typescript
403
- // === Test Cycle Iteration ===
404
-
405
- // Create test cycle with public API
322
+ // Test Cycle: Set/get iteration
406
323
  const testCycle = await api.TestCycle.createTestCycle({
407
324
  projectKey: 'M12',
408
325
  name: 'Sprint 1 Testing'
409
326
  });
410
-
411
- // Set iteration using private API (supplements createTestCycle)
412
327
  await api.Private.ExtendedData.updateTestCycleIteration(credentials, {
413
328
  testCycleKey: testCycle.key,
414
329
  projectId: 10313,
415
330
  iterationId: 10952254
416
331
  });
417
-
418
- // Get iteration data (supplements getTestCycle)
419
- const testCycleIteration = await api.Private.ExtendedData.getTestCycleIteration(credentials, {
332
+ const cycleIteration = await api.Private.ExtendedData.getTestCycleIteration(credentials, {
420
333
  testCycleKey: 'M12-R1',
421
334
  projectId: 10313
422
335
  });
423
- console.log('Test Cycle Iteration ID:', testCycleIteration.iterationId); // null if not set
424
-
425
- // === Test Execution Iteration ===
426
336
 
427
- // Create test execution with public API (returns void)
337
+ // Test Execution: Set/get iteration and version
428
338
  await api.TestExecution.createTestExecution({
429
339
  projectKey: 'M12',
430
340
  testCaseKey: 'M12-T1',
431
341
  testCycleKey: 'M12-R1',
432
342
  statusName: 'Pass'
433
343
  });
434
-
435
- // Note: createTestExecution returns no data, so you need to know the execution key
436
- // or look it up using listTestExecutions() after creation
437
-
438
- // Set iteration using private API (supplements createTestExecution)
344
+ // Note: createTestExecution returns void - use known key or look up via listTestExecutions()
439
345
  await api.Private.ExtendedData.updateTestExecutionIteration(credentials, {
440
- testExecutionKey: 'M12-E1', // Use known key or look up after creation
346
+ testExecutionKey: 'M12-E1',
441
347
  projectId: 10313,
442
348
  iterationId: 10952254
443
349
  });
444
-
445
- // Get iteration data (supplements getTestExecution)
446
- const testExecutionIteration = await api.Private.ExtendedData.getTestExecutionIteration(credentials, {
447
- testExecutionKey: 'M12-E1',
448
- projectId: 10313
350
+ await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
351
+ testExecutionKey: 'M15-E3',
352
+ projectId: 10316,
353
+ jiraVersionId: 10102
449
354
  });
450
- console.log('Test Execution Iteration ID:', testExecutionIteration.iterationId); // null if not set
451
355
 
452
- // Clear iteration by setting to null
356
+ // Clear by setting to null
453
357
  await api.Private.ExtendedData.updateTestCycleIteration(credentials, {
454
358
  testCycleKey: 'M12-R1',
455
359
  projectId: 10313,
456
360
  iterationId: null
457
361
  });
458
-
459
- // === Test Execution Version (Release Version) ===
460
-
461
- // Create test execution with public API (returns void)
462
- await api.TestExecution.createTestExecution({
463
- projectKey: 'M15',
464
- testCaseKey: 'M15-T3',
465
- testCycleKey: 'M15-R1',
466
- statusName: 'Pass'
467
- });
468
-
469
- // Note: createTestExecution returns no data, so you need to know the execution key
470
- // or look it up using listTestExecutions() after creation
471
-
472
- // Set Jira version ID (release version) using private API (supplements createTestExecution)
473
- await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
474
- testExecutionKey: 'M15-E3', // Use known key or look up after creation
475
- projectId: 10316,
476
- jiraVersionId: 10102
477
- });
478
-
479
- // Get version data (supplements getTestExecution)
480
- const testExecutionVersion = await api.Private.ExtendedData.getTestExecutionVersion(credentials, {
481
- testExecutionKey: 'M15-E3',
482
- projectId: 10316
483
- });
484
- console.log('Jira Version ID:', testExecutionVersion.jiraVersionId); // null if not set
485
-
486
- // Clear version by setting to null
487
- await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
488
- testExecutionKey: 'M15-E3',
489
- projectId: 10316,
490
- jiraVersionId: null
491
- });
492
362
  ```
493
363
 
494
364
  ### Example: Test Case Archiving
495
365
 
496
- The public API does not expose the archived flag on test cases. Use the `TestCaseArchiving` sub-group to list archived test cases and perform archiving/unarchiving operations.
366
+ The public API does not expose the archived flag. Use `TestCaseArchiving` to list, archive, and unarchive test cases.
497
367
 
498
368
  ```typescript
499
- // === Get Archived Test Cases ===
500
-
501
- // Get first page of archived test cases
369
+ // Get archived test cases (paginated, optional query filter)
502
370
  const archived = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
503
371
  projectId: 10316,
504
372
  maxResults: 50,
505
- startAt: 0
506
- });
507
- console.log(`Found ${archived.total} archived test cases`);
508
- archived.results.forEach(tc => {
509
- console.log(`- ${tc.key}: ${tc.name}`);
373
+ startAt: 0,
374
+ query: "testCase.name CONTAINS 'migration'" // optional
510
375
  });
511
376
 
512
- // Get archived test cases with custom query filter
513
- const filtered = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
514
- projectId: 10316,
515
- query: "testCase.name CONTAINS 'migration'",
516
- maxResults: 100
517
- });
518
-
519
- // === Archive Test Cases ===
520
-
521
- // Archive a single test case
522
- await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
523
- projectId: 10316,
524
- testCaseIds: [288004503]
525
- });
526
-
527
- // Archive multiple test cases
377
+ // Archive test cases (single or multiple)
528
378
  await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
529
379
  projectId: 10316,
530
380
  testCaseIds: [288004503, 288004504, 288004505]
531
381
  });
532
382
 
533
- // === Unarchive Test Cases ===
534
-
535
- // Unarchive a single test case
383
+ // Unarchive test cases
536
384
  await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
537
385
  projectId: 10316,
538
386
  testCaseIds: [288004503]
539
387
  });
540
-
541
- // Unarchive multiple test cases
542
- await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
543
- projectId: 10316,
544
- testCaseIds: [288004503, 288004504, 288004505]
545
- });
546
388
  ```
547
389
 
548
- **Note:** Version numbers are absolute (1-based: 1 = first version ever created, 2 = second version, etc. The highest number is the current/latest version). Use `listTestCaseVersions()` to find the total number of versions and identify the latest. If `version` is not provided, the latest version is used.
549
-
550
- **Important Notes:**
551
- - Private API methods require a `PrivateApiCredentials` object with `userEmail`, `apiToken`, and `jiraInstanceUrl`
552
- - The Context JWT token expires after 15 minutes and must be retrieved for each private API call
553
- - All private API methods automatically handle Context JWT retrieval internally
554
- - Methods that accept keys (like `testCaseKey`) automatically look up numeric IDs when needed
390
+ **Notes:**
391
+ - Version numbers are absolute (1-based). Use `listTestCaseVersions()` to find available versions. If `version` is not provided, the latest version is used.
392
+ - Private API methods require `PrivateApiCredentials` (`userEmail`, `apiToken`, `jiraInstanceUrl`). Context JWT tokens expire after 15 minutes and are automatically retrieved internally.
393
+ - Methods accept keys (e.g., `testCaseKey`) and automatically look up numeric IDs when needed.
555
394
 
556
395
  ## Contact
557
396
 
@@ -559,6 +398,10 @@ Feel free to drop ideas, suggestions or improvements into our [Community hub](ht
559
398
 
560
399
  ## Changelog
561
400
 
401
+ ### 1.3.9
402
+
403
+ - **Changed**: Readme fixes
404
+
562
405
  ### 1.3.8
563
406
 
564
407
  - **Added**: `getTestExecutionVersion()` - Get Jira version ID (release version) for a test execution (supplements public `getTestExecution()`)
package/dist/README.md CHANGED
@@ -44,29 +44,29 @@ const apiEU = createZephyrApi(
44
44
  ## Supported API calls
45
45
 
46
46
  - [fetch](https://docs.adaptavist.com/src/managed-apis/managed-api-abstractions)
47
- - Project
47
+ - ### Project
48
48
  - [listProjects](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Projects/operation/listProjects)
49
49
  - [getProject](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Projects/operation/getProject)
50
- - Status
50
+ - ### Status
51
51
  - [listStatuses](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/listStatuses)
52
52
  - [getStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/getStatus)
53
53
  - [createStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/createStatus)
54
54
  - [updateStatus](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Statuses/operation/updateStatus)
55
- - Priority
55
+ - ### Priority
56
56
  - [listPriorities](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/listPriorities)
57
57
  - [getPriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/getPriority)
58
58
  - [createPriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/createPriority)
59
59
  - [updatePriority](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/updatePriority)
60
- - Environment
60
+ - ### Environment
61
61
  - [listEnvironments](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/listEnvironments)
62
62
  - [getEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/getEnvironment)
63
63
  - [createEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/createEnvironment)
64
64
  - [updateEnvironment](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Environments/operation/updateEnvironment)
65
- - Folder
65
+ - ### Folder
66
66
  - [listFolders](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/listFolders)
67
67
  - [getFolder](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/getFolder)
68
68
  - [createFolder](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Folders/operation/createFolder)
69
- - TestCase
69
+ - ### TestCase
70
70
  - [listTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/listTestCases)
71
71
  - [listTestCasesCursorPaginated](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/listTestCasesCursorPaginated)
72
72
  - [getTestCase](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/getTestCase)
@@ -81,7 +81,7 @@ const apiEU = createZephyrApi(
81
81
  - [createTestCaseTestScript](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/createTestCaseTestScript)
82
82
  - [getTestCaseTestSteps](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/getTestCaseTestSteps)
83
83
  - [createTestCaseTestSteps](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cases/operation/createTestCaseTestSteps)
84
- - TestCycle
84
+ - ### TestCycle
85
85
  - [listTestCycles](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/listTestCycles)
86
86
  - [getTestCycle](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/getTestCycle)
87
87
  - [createTestCycle](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycle)
@@ -89,14 +89,14 @@ const apiEU = createZephyrApi(
89
89
  - [getTestCycleLinks](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/getTestCycleLinks)
90
90
  - [createTestCycleIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycleIssueLink)
91
91
  - [createTestCycleWebLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Cycles/operation/createTestCycleWebLink)
92
- - TestPlan
92
+ - ### TestPlan
93
93
  - [listTestPlans](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/listTestPlans)
94
94
  - [getTestPlan](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/getTestPlan)
95
95
  - [createTestPlan](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlan)
96
96
  - [createTestPlanIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanIssueLink)
97
97
  - [createTestPlanWebLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanWebLink)
98
98
  - [createTestPlanTestCycleLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Plans/operation/createTestPlanTestCycleLink)
99
- - TestExecution
99
+ - ### TestExecution
100
100
  - [listTestExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutions)
101
101
  - [listTestExecutionsNextgen](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutionsNextgen)
102
102
  - [getTestExecution](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/getTestExecution)
@@ -107,59 +107,58 @@ const apiEU = createZephyrApi(
107
107
  - [syncTestExecutionScript](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/syncTestExecutionScript)
108
108
  - [listTestExecutionLinks](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/listTestExecutionLinks)
109
109
  - [createTestExecutionIssueLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecutionIssueLink)
110
- - Link
110
+ - ### Link
111
111
  - [deleteLink](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Links/operation/deleteLink)
112
- - IssueLink
112
+ - ### IssueLink
113
113
  - [getIssueLinkTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestCases)
114
114
  - [getIssueLinkTestCycles](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestCycles)
115
115
  - [getIssueLinkTestPlans](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkTestPlans)
116
116
  - [getIssueLinkExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Issue-Links/operation/getIssueLinkExecutions)
117
- - Automation
117
+ - ### Automation
118
118
  - [createCustomExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCustomExecutions)
119
119
  - [createCucumberExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCucumberExecutions)
120
120
  - [createJUnitExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createJUnitExecutions)
121
121
  - [retrieveBDDTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/retrieveBDDTestCases)
122
- - Private ⚠️
123
- > **⚠️ WARNING: Private API Methods**
124
- >
125
- > The following methods use Zephyr's private/unofficial API endpoints that are:
126
- > - **Not officially supported** by SmartBear
127
- > - **Not part of the public API documentation**
128
- > - **Subject to change at any time** without notice
129
- > - **Not covered by Standard Support**
130
- >
131
- > Use these methods at your own risk. They may break with future Zephyr updates.
132
-
133
- - Authentication
134
- - **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
135
- - Comments
136
- - **Test Case**: `getTestCaseComments`, `createTestCaseComment`
137
- - **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
138
- - **Test Plan**: `getTestPlanComments`, `createTestPlanComment`
139
- - Config
140
- - **CustomFields**: `createCustomField`, `getCustomFields`
141
- - **Labels**: `getLabels`, `createLabel`
142
- - **Iterations**: `getIterations`, `createIteration`
143
- - **DataSets**: `getDataSets`, `createDataSet`, `updateDataSet`
144
- - **archiveConfig** - Archive a config item (Environment, Iteration, or Status)
145
- - **unarchiveConfig** - Unarchive a config item (Environment, Iteration, or Status)
146
- - Versions
147
- - **createTestCaseVersion** - Create a new test case version
148
- - Attachments
149
- - **Test Case**: `getTestCaseAttachments`, `downloadAttachment`, `createTestCaseAttachment`
150
- - **Test Step**: `getTestStepAttachments`, `downloadTestStepAttachment`, `createTestStepAttachment`
151
- - **Test Cycle**: `getTestCycleAttachments`, `downloadTestCycleAttachment`, `createTestCycleAttachment`
152
- - **Test Plan**: `getTestPlanAttachments`, `downloadTestPlanAttachment`, `createTestPlanAttachment`
153
- - **Test Execution**: `getTestExecutionAttachments`, `downloadTestExecutionAttachment`, `createTestExecutionAttachment`
154
- - **Test Execution Step**: `getTestExecutionStepAttachments`, `downloadTestExecutionStepAttachment`, `createTestExecutionStepAttachment`
155
- - VersionControl
156
- - **Test Case (version-specific)**: `getTestCaseIssueLinks`, `getTestCaseWebLinks`, `getTestCaseTestScript`, `getTestCaseTestSteps`
157
- - **Test Execution Step**: `getTestExecutionStepIssueLinks`, `createTestExecutionStepIssueLink`
158
- - ExtendedData (supplements public API with extended data: iterations and versions)
159
- - **Test Cycle**: `getTestCycleIteration`, `updateTestCycleIteration`
160
- - **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
161
- - TestCaseArchiving (access archived test cases and archiving operations)
162
- - **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
122
+ - **Private** ⚠️
123
+ > **⚠️ WARNING: Private API Methods**
124
+ >
125
+ > The following methods use Zephyr's private/unofficial API endpoints that are:
126
+ > - **Not officially supported** by SmartBear
127
+ > - **Not part of the public API documentation**
128
+ > - **Subject to change at any time** without notice
129
+ > - **Not covered by Standard Support**
130
+ >
131
+ > Use these methods at your own risk. They may break with future Zephyr updates.
132
+ - ### Authentication
133
+ - **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
134
+ - ### Comments
135
+ - **Test Case**: `getTestCaseComments`, `createTestCaseComment`
136
+ - **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
137
+ - **Test Plan**: `getTestPlanComments`, `createTestPlanComment`
138
+ - ### Config
139
+ - **CustomFields**: `createCustomField`, `getCustomFields`
140
+ - **Labels**: `getLabels`, `createLabel`
141
+ - **Iterations**: `getIterations`, `createIteration`
142
+ - **DataSets**: `getDataSets`, `createDataSet`, `updateDataSet`
143
+ - **archiveConfig** - Archive a config item (Environment, Iteration, or Status)
144
+ - **unarchiveConfig** - Unarchive a config item (Environment, Iteration, or Status)
145
+ - ### Versions
146
+ - **createTestCaseVersion** - Create a new test case version
147
+ - ### Attachments
148
+ - **Test Case**: `getTestCaseAttachments`, `downloadAttachment`, `createTestCaseAttachment`
149
+ - **Test Step**: `getTestStepAttachments`, `downloadTestStepAttachment`, `createTestStepAttachment`
150
+ - **Test Cycle**: `getTestCycleAttachments`, `downloadTestCycleAttachment`, `createTestCycleAttachment`
151
+ - **Test Plan**: `getTestPlanAttachments`, `downloadTestPlanAttachment`, `createTestPlanAttachment`
152
+ - **Test Execution**: `getTestExecutionAttachments`, `downloadTestExecutionAttachment`, `createTestExecutionAttachment`
153
+ - **Test Execution Step**: `getTestExecutionStepAttachments`, `downloadTestExecutionStepAttachment`, `createTestExecutionStepAttachment`
154
+ - ### VersionControl
155
+ - **Test Case (version-specific)**: `getTestCaseIssueLinks`, `getTestCaseWebLinks`, `getTestCaseTestScript`, `getTestCaseTestSteps`
156
+ - **Test Execution Step**: `getTestExecutionStepIssueLinks`, `createTestExecutionStepIssueLink`
157
+ - ### ExtendedData (supplements public API with extended data: iterations and versions)
158
+ - **Test Cycle**: `getTestCycleIteration`, `updateTestCycleIteration`
159
+ - **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
160
+ - ### TestCaseArchiving (access archived test cases and archiving operations)
161
+ - **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
163
162
 
164
163
  ## Private API Authentication
165
164
 
@@ -186,133 +185,69 @@ const credentials = {
186
185
  const contextJwt = await api.Private.Authentication.getContextJwt(credentials);
187
186
  ```
188
187
 
189
- ### Example: Create Custom Field
188
+ ### Example: Config Operations
190
189
 
191
190
  ```typescript
192
- // Create a custom field for test cases
191
+ // Create custom field
193
192
  const customField = await api.Private.Config.CustomFields.createCustomField(
194
- credentials,
195
- 'TEST_CASE',
196
- {
193
+ credentials, 'TEST_CASE', {
197
194
  projectId: 10017,
198
195
  name: 'Build Number',
199
196
  type: 'SINGLE_LINE_TEXT',
200
- required: false,
201
- index: 4,
202
- category: 'TEST_CASE',
203
- archived: false
197
+ required: false
204
198
  }
205
199
  );
206
- ```
207
-
208
- ### Example: Create Label
209
200
 
210
- ```typescript
211
- // Create a new label
201
+ // Create label
212
202
  await api.Private.Config.Labels.createLabel(credentials, {
213
203
  projectId: 10233,
214
204
  name: 'automated'
215
205
  });
216
206
 
217
- // Get all labels
218
- const labels = await api.Private.Config.Labels.getLabels(credentials, {
219
- projectId: 10233
220
- });
221
- ```
222
-
223
- ### Example: Create Iteration
224
-
225
- ```typescript
226
- // Create a new iteration
207
+ // Create iteration
227
208
  const iteration = await api.Private.Config.Iterations.createIteration(credentials, {
228
209
  projectId: 10233,
229
210
  name: 'Sprint 1',
230
211
  description: 'First sprint of Q1'
231
212
  });
232
213
 
233
- // Get all iterations
234
- const iterations = await api.Private.Config.Iterations.getIterations(credentials, {
235
- projectId: 10233
236
- });
237
- ```
238
-
239
- ### Example: Create and Update Data Set
240
-
241
- ```typescript
242
- // Create a new data set (empty)
214
+ // Create and update data set
243
215
  const dataSet = await api.Private.Config.DataSets.createDataSet(credentials, {
244
216
  projectId: 10233,
245
217
  name: 'Environment'
246
218
  });
247
-
248
- // Add items/options to the data set
249
- const updatedDataSet = await api.Private.Config.DataSets.updateDataSet(credentials, {
219
+ await api.Private.Config.DataSets.updateDataSet(credentials, {
250
220
  id: dataSet.id,
251
- name: 'Environment',
252
221
  projectId: 10233,
253
222
  items: [
254
223
  { name: 'Production', index: 0, archived: false },
255
- { name: 'Staging', index: 1, archived: false },
256
- { name: 'Development', index: 2, archived: false }
224
+ { name: 'Staging', index: 1, archived: false }
257
225
  ]
258
226
  });
259
-
260
- // Get all data sets
261
- const dataSets = await api.Private.Config.DataSets.getDataSets(credentials, {
262
- projectId: 10233
263
- });
264
227
  ```
265
228
 
266
229
  ### Example: Archive and Unarchive Config Items
267
230
 
268
231
  ```typescript
269
- // Archive an environment
270
- const archivedEnv = await api.Private.Config.archiveConfig(credentials, {
232
+ // Archive an environment or iteration
233
+ await api.Private.Config.archiveConfig(credentials, {
271
234
  type: 'Environment',
272
235
  id: 10873400,
273
236
  projectId: 10233
274
237
  });
275
238
 
276
- // Unarchive an iteration
277
- const unarchivedIteration = await api.Private.Config.unarchiveConfig(credentials, {
278
- type: 'Iteration',
279
- id: 10909775,
280
- projectId: 10233
281
- });
282
-
283
- // Archive a test case status
284
- const archivedTestCaseStatus = await api.Private.Config.archiveConfig(credentials, {
239
+ // Archive statuses (supports: TestCaseStatus, TestPlanStatus, TestCycleStatus, TestExecutionStatus)
240
+ await api.Private.Config.archiveConfig(credentials, {
285
241
  type: 'TestCaseStatus',
286
242
  id: 10952238,
287
243
  projectId: 10313
288
244
  });
289
245
 
290
- // Archive a test plan status
291
- const archivedTestPlanStatus = await api.Private.Config.archiveConfig(credentials, {
292
- type: 'TestPlanStatus',
293
- id: 10952241,
294
- projectId: 10313
295
- });
296
-
297
- // Archive a test cycle status
298
- const archivedTestCycleStatus = await api.Private.Config.archiveConfig(credentials, {
299
- type: 'TestCycleStatus',
300
- id: 10952244,
301
- projectId: 10313
302
- });
303
-
304
- // Archive a test execution status
305
- const archivedTestExecutionStatus = await api.Private.Config.archiveConfig(credentials, {
306
- type: 'TestExecutionStatus',
307
- id: 10952247,
308
- projectId: 10313
309
- });
310
-
311
- // Unarchive any status (same types supported)
312
- const unarchivedStatus = await api.Private.Config.unarchiveConfig(credentials, {
313
- type: 'TestCaseStatus',
314
- id: 10952238,
315
- projectId: 10313
246
+ // Unarchive any config item (same types supported)
247
+ await api.Private.Config.unarchiveConfig(credentials, {
248
+ type: 'Iteration',
249
+ id: 10909775,
250
+ projectId: 10233
316
251
  });
317
252
  ```
318
253
 
@@ -347,46 +282,30 @@ const attachment = await api.Private.Attachments.createTestCaseAttachment(
347
282
  );
348
283
  ```
349
284
 
350
- ### Example: Get Version-Specific Data
285
+ ### Example: Version-Specific Data
351
286
 
352
287
  ```typescript
353
- // Get issue links for current version
288
+ // Get version-specific data for test cases (version parameter is optional, defaults to latest)
354
289
  const issueLinks = await api.Private.VersionControl.getTestCaseIssueLinks(credentials, {
355
290
  testCaseKey: 'PROJ-T1',
356
- projectId: 10233
357
- });
358
-
359
- // Get web links for version 2 (previous version)
360
- const webLinks = await api.Private.VersionControl.getTestCaseWebLinks(credentials, {
361
- testCaseKey: 'PROJ-T1',
362
- projectId: 10233,
363
- version: 2
291
+ projectId: 10233,
292
+ version: 2 // Get links for version 2
364
293
  });
365
294
 
366
- // Get test script for version 3
367
295
  const testScript = await api.Private.VersionControl.getTestCaseTestScript(credentials, {
368
- testCaseKey: 'PROJ-T1',
369
- projectId: 10233,
370
- version: 3
371
- });
372
-
373
- // Get test steps for version 4 (current version, if there are 4 versions total)
374
- const testSteps = await api.Private.VersionControl.getTestCaseTestSteps(credentials, {
375
296
  testCaseKey: 'PROJ-T1',
376
297
  projectId: 10233,
377
- version: 4
298
+ version: 3
378
299
  });
379
300
 
380
- // Get issue links for a test execution step (useful for migration)
381
- const stepIssueLinks = await api.Private.VersionControl.getTestExecutionStepIssueLinks(credentials, {
301
+ // Test execution step issue links
302
+ const stepLinks = await api.Private.VersionControl.getTestExecutionStepIssueLinks(credentials, {
382
303
  testExecutionKey: 'PROJ-E1',
383
304
  stepIndex: 0,
384
305
  projectId: 10233
385
306
  });
386
- // Returns: [{ id: 169099471, issueId: '66019', type: 'BLOCKS' }, ...]
387
307
 
388
- // Create an issue link for a test execution step
389
- const stepLink = await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
308
+ await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
390
309
  testExecutionKey: 'PROJ-E1',
391
310
  stepIndex: 0,
392
311
  issueId: 66019,
@@ -395,163 +314,83 @@ const stepLink = await api.Private.VersionControl.createTestExecutionStepIssueLi
395
314
  });
396
315
  ```
397
316
 
398
- ### Example: Get and Set Extended Data (Supplements Public API)
317
+ ### Example: Extended Data (Supplements Public API)
399
318
 
400
- The public API does not support getting or setting iterations for Test Cycles and Test Executions, or Jira version IDs (release versions) for Test Executions. Use the `ExtendedData` sub-group to supplement public API calls with this additional data.
319
+ The public API does not support iterations for Test Cycles/Executions or Jira version IDs for Test Executions. Use `ExtendedData` to supplement public API calls.
401
320
 
402
321
  ```typescript
403
- // === Test Cycle Iteration ===
404
-
405
- // Create test cycle with public API
322
+ // Test Cycle: Set/get iteration
406
323
  const testCycle = await api.TestCycle.createTestCycle({
407
324
  projectKey: 'M12',
408
325
  name: 'Sprint 1 Testing'
409
326
  });
410
-
411
- // Set iteration using private API (supplements createTestCycle)
412
327
  await api.Private.ExtendedData.updateTestCycleIteration(credentials, {
413
328
  testCycleKey: testCycle.key,
414
329
  projectId: 10313,
415
330
  iterationId: 10952254
416
331
  });
417
-
418
- // Get iteration data (supplements getTestCycle)
419
- const testCycleIteration = await api.Private.ExtendedData.getTestCycleIteration(credentials, {
332
+ const cycleIteration = await api.Private.ExtendedData.getTestCycleIteration(credentials, {
420
333
  testCycleKey: 'M12-R1',
421
334
  projectId: 10313
422
335
  });
423
- console.log('Test Cycle Iteration ID:', testCycleIteration.iterationId); // null if not set
424
-
425
- // === Test Execution Iteration ===
426
336
 
427
- // Create test execution with public API (returns void)
337
+ // Test Execution: Set/get iteration and version
428
338
  await api.TestExecution.createTestExecution({
429
339
  projectKey: 'M12',
430
340
  testCaseKey: 'M12-T1',
431
341
  testCycleKey: 'M12-R1',
432
342
  statusName: 'Pass'
433
343
  });
434
-
435
- // Note: createTestExecution returns no data, so you need to know the execution key
436
- // or look it up using listTestExecutions() after creation
437
-
438
- // Set iteration using private API (supplements createTestExecution)
344
+ // Note: createTestExecution returns void - use known key or look up via listTestExecutions()
439
345
  await api.Private.ExtendedData.updateTestExecutionIteration(credentials, {
440
- testExecutionKey: 'M12-E1', // Use known key or look up after creation
346
+ testExecutionKey: 'M12-E1',
441
347
  projectId: 10313,
442
348
  iterationId: 10952254
443
349
  });
444
-
445
- // Get iteration data (supplements getTestExecution)
446
- const testExecutionIteration = await api.Private.ExtendedData.getTestExecutionIteration(credentials, {
447
- testExecutionKey: 'M12-E1',
448
- projectId: 10313
350
+ await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
351
+ testExecutionKey: 'M15-E3',
352
+ projectId: 10316,
353
+ jiraVersionId: 10102
449
354
  });
450
- console.log('Test Execution Iteration ID:', testExecutionIteration.iterationId); // null if not set
451
355
 
452
- // Clear iteration by setting to null
356
+ // Clear by setting to null
453
357
  await api.Private.ExtendedData.updateTestCycleIteration(credentials, {
454
358
  testCycleKey: 'M12-R1',
455
359
  projectId: 10313,
456
360
  iterationId: null
457
361
  });
458
-
459
- // === Test Execution Version (Release Version) ===
460
-
461
- // Create test execution with public API (returns void)
462
- await api.TestExecution.createTestExecution({
463
- projectKey: 'M15',
464
- testCaseKey: 'M15-T3',
465
- testCycleKey: 'M15-R1',
466
- statusName: 'Pass'
467
- });
468
-
469
- // Note: createTestExecution returns no data, so you need to know the execution key
470
- // or look it up using listTestExecutions() after creation
471
-
472
- // Set Jira version ID (release version) using private API (supplements createTestExecution)
473
- await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
474
- testExecutionKey: 'M15-E3', // Use known key or look up after creation
475
- projectId: 10316,
476
- jiraVersionId: 10102
477
- });
478
-
479
- // Get version data (supplements getTestExecution)
480
- const testExecutionVersion = await api.Private.ExtendedData.getTestExecutionVersion(credentials, {
481
- testExecutionKey: 'M15-E3',
482
- projectId: 10316
483
- });
484
- console.log('Jira Version ID:', testExecutionVersion.jiraVersionId); // null if not set
485
-
486
- // Clear version by setting to null
487
- await api.Private.ExtendedData.updateTestExecutionVersion(credentials, {
488
- testExecutionKey: 'M15-E3',
489
- projectId: 10316,
490
- jiraVersionId: null
491
- });
492
362
  ```
493
363
 
494
364
  ### Example: Test Case Archiving
495
365
 
496
- The public API does not expose the archived flag on test cases. Use the `TestCaseArchiving` sub-group to list archived test cases and perform archiving/unarchiving operations.
366
+ The public API does not expose the archived flag. Use `TestCaseArchiving` to list, archive, and unarchive test cases.
497
367
 
498
368
  ```typescript
499
- // === Get Archived Test Cases ===
500
-
501
- // Get first page of archived test cases
369
+ // Get archived test cases (paginated, optional query filter)
502
370
  const archived = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
503
371
  projectId: 10316,
504
372
  maxResults: 50,
505
- startAt: 0
506
- });
507
- console.log(`Found ${archived.total} archived test cases`);
508
- archived.results.forEach(tc => {
509
- console.log(`- ${tc.key}: ${tc.name}`);
373
+ startAt: 0,
374
+ query: "testCase.name CONTAINS 'migration'" // optional
510
375
  });
511
376
 
512
- // Get archived test cases with custom query filter
513
- const filtered = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
514
- projectId: 10316,
515
- query: "testCase.name CONTAINS 'migration'",
516
- maxResults: 100
517
- });
518
-
519
- // === Archive Test Cases ===
520
-
521
- // Archive a single test case
522
- await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
523
- projectId: 10316,
524
- testCaseIds: [288004503]
525
- });
526
-
527
- // Archive multiple test cases
377
+ // Archive test cases (single or multiple)
528
378
  await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
529
379
  projectId: 10316,
530
380
  testCaseIds: [288004503, 288004504, 288004505]
531
381
  });
532
382
 
533
- // === Unarchive Test Cases ===
534
-
535
- // Unarchive a single test case
383
+ // Unarchive test cases
536
384
  await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
537
385
  projectId: 10316,
538
386
  testCaseIds: [288004503]
539
387
  });
540
-
541
- // Unarchive multiple test cases
542
- await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
543
- projectId: 10316,
544
- testCaseIds: [288004503, 288004504, 288004505]
545
- });
546
388
  ```
547
389
 
548
- **Note:** Version numbers are absolute (1-based: 1 = first version ever created, 2 = second version, etc. The highest number is the current/latest version). Use `listTestCaseVersions()` to find the total number of versions and identify the latest. If `version` is not provided, the latest version is used.
549
-
550
- **Important Notes:**
551
- - Private API methods require a `PrivateApiCredentials` object with `userEmail`, `apiToken`, and `jiraInstanceUrl`
552
- - The Context JWT token expires after 15 minutes and must be retrieved for each private API call
553
- - All private API methods automatically handle Context JWT retrieval internally
554
- - Methods that accept keys (like `testCaseKey`) automatically look up numeric IDs when needed
390
+ **Notes:**
391
+ - Version numbers are absolute (1-based). Use `listTestCaseVersions()` to find available versions. If `version` is not provided, the latest version is used.
392
+ - Private API methods require `PrivateApiCredentials` (`userEmail`, `apiToken`, `jiraInstanceUrl`). Context JWT tokens expire after 15 minutes and are automatically retrieved internally.
393
+ - Methods accept keys (e.g., `testCaseKey`) and automatically look up numeric IDs when needed.
555
394
 
556
395
  ## Contact
557
396
 
@@ -559,6 +398,10 @@ Feel free to drop ideas, suggestions or improvements into our [Community hub](ht
559
398
 
560
399
  ## Changelog
561
400
 
401
+ ### 1.3.9
402
+
403
+ - **Changed**: Readme fixes
404
+
562
405
  ### 1.3.8
563
406
 
564
407
  - **Added**: `getTestExecutionVersion()` - Get Jira version ID (release version) for a test execution (supplements public `getTestExecution()`)
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbaileysr/zephyr-managed-api",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbaileysr/zephyr-managed-api",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",