Test Planning (cycles and phases)
Create a cycle
Use the following operation to create a cycle in Zephyr Enterprise:
POST /flex/services/rest/latest/cycle
Request format
To create a cycle, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/latest/cycle
Request body
{ "name": "Cycle two", "build": "", "environment": "", "status": 0, "cycleStartDate": "11/01/2019", "cycleEndDate": "11/15/2019", "releaseId": 1 }
name - the cycle name.
build = the build number.
releaseId = the ID of the release where you want to create the cycle.
Response body
{ "id": 2, "environment": "", "build": "", "name": "Cycle two", "startDate": 1572591600000, "endDate": 1573804800000, "cycleStartDate": "11/01/2019", "cycleEndDate": "11/15/2019", "status": 0, "revision": 4, "releaseId": 1, "cyclePhases": [], "createdOn": 1594795307717 }
Create a cycle phase from the Test Repository
Use the following operation to create a cycle phase from the Test Repository:
POST /flex/services/rest/v3/cycle/{cycleid}/phase
Request format
To create a cycle phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/cycle/{cycleid}/phase
Request body
{ "phaseStartDate":"07/16/2020", "phaseEndDate":"07/31/2020", "freeForm":false, "tcrCatalogTreeId":1 }
PhaseStartDate - the start date of the cycle.
PhaseEndDate - the end date of the cycle.
freeForm (boolean) - false if you want to pull the whole folder from repository.
tcrCatalogTreeId - the tree ID of the folder in the repository.
Create a cycle phase (a free-form phase)
Use the following operation to create a free-form cycle phase in Zephyr Enterprise:
POST /flex/services/rest/v3/cycle/{cycleid}/phase
Request format
To create a free-form cycle phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/cycle/{cycleid}/phase
Request body
{ "phaseStartDate":"07/17/2020", "phaseEndDate":"07/31/2020", "releaseId":12, "name":"new Phase Z", "freeForm":true }
PhaseStartDate - the start date of the phase.
PhaseEndDate - the end date of the phase.
freeForm (boolean) - true.
name - the name of the cycle phase.
Response body
{ "id": 6, "name": "new Phase Z", "tcrCatalogTreeId": 164, "freeForm": true, "startDate": 1594969200000, "endDate": 1596178800000, "createdOn": 1594990702000, "cycleId": 4, "phaseStartDate": "07/17/2020", "phaseEndDate": "07/31/2020", "resetExecution": false }
Add the test case to the free-form phase
You can do this in any of the following ways:
by browsing the test case tree
by performing a quick or an advanced search (ZQL)
by pulling test cases from other cycles or phases
To add a test case to a free-form phase by browsing the test case tree, use the following operation:
POST /flex/services/rest/v3/assignmenttree/{cyclephaseid}/assign/bytree/{parenttreeid}?includehierarchy=false
Request format
To add a test case to a free-form phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/assignmenttree/{cyclephaseid}/assign/bytree/{parenttreeid}?includehierarchy=false
cyclephaseid - the ID of the cycle phase.
parenttreeid - the ID of the parent tree.
includehierarchy - (boolean). If true
, the tree structure will be as it is in the Test Repository. If false
, the test case will be added to a free form phase (parent node).
Request body (to add the entire tree)
[ { "treeid": 8, "tctIds": [], "isExclusion": false }, { "treeid": 9, "tctIds": [], "isExclusion": false } ]
treeid - the ID of the tree that should be added to the free-form phase.
Response
"\u003c?xml version\u003d\"1.0\" encoding\u003d\"UTF-8\"?\u003e\n\u003cTCRCatalogTree frozenId\u003d\"10\" frozenName\u003d\"FFP\" sourceId\u003d\"10\" sourceName\u003d\"FFP\" selected\u003d\"true\" action\u003d\"modified\" testcases_added\u003d\"7\" testcases_deleted\u003d\"0\" testcases_ignored\u003d\"0\" testcases_added_cumulative\u003d\"7\" testcases_deleted_cumulative\u003d\"0\" testcases_ignored_cumulative\u003d\"0\"\u003e\u003cTestcases/\u003e\u003c/TCRCatalogTree\u003e"
Request body (to add test cases)
[ { "treeid": 8, "tctIds": [ 100, 101 ], "isExclusion": true }, { "treeid": 9, "tctIds": [ 105 ], "isExclusion": true } ]
tctIds - the test case version ID you got from the response of the added or updated test case.
Here, two test cases are added from treeid 8, and one test case is added from treeid 9.
To add a test case to a free form phase by performing a quick or an advanced search (ZQL), use the following operation:
POST /flex/services/rest/v3/assignmenttree/{cyclephaseid}/assign/bysearch/{parenttreeid}?maxresults=10&zql=false&includehierarchy=false
Request format
To add a test case to a free-form phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/assignmenttree/{cyclephaseid}/assign/bysearch/{parenttreeid}?maxresults=10&zql=false&includehierarchy=false
Request (to add all the test cases)
http://localhost/flex/services/rest/v3/assignmenttree/3/assign/bysearch/17?includehierarchy=false&zql=true&searchquery=priority = "P2"&maxresults=10
Other search parameters: estimatedTime, testcaseid, tag, creator, release, project, priority, altid, automated, folder, contents, comments, name and custom fields.
cyclephaseid - you get it from the response upon adding a phase to the cycle.
parenttreeid - the tree ID of the free-form phase you get in the response upon adding a phase to the cycle.
includehierarchy - (boolean). If true
, the tree structure will be as that in the Test Repository. If false
, the test case will be added to the free-form phase (parent node).
maxresults - will fetch the results accordingly (if 10 is given, will fetch only 10 records).
zql - can be true or false. If true
, you need to provide a ZQL query in the searchquery
parameter. If false
, can perform a basic search. You need to add search criteria in the searchquery
parameter.
Request header and Payload (to add some test cases)
http://localhost/flex/services/rest/v3/assignmenttree/3/assign/bysearch/17?includehierarchy=false&zql=true&searchquery=priority = "P2"&maxresults=10 { "ids": [ 101, 102 ] }
101 and 102 - the tctID you get from the response upon adding or updating the test case.
To add a test case to a free-form phase by pulling test cases from other cycles or phases, use the following operation:
POST /flex/services/rest/latest/assignmenttree/{cyclephaseid}/assign/byschedule?maxresults=10&scheduleids=&maintainassignments=false&parenttreeid=&includehierarchy=false&isCreateWithLatestVersion=true
Request format
To add a test case to a free-form phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/latest/assignmenttree/{cyclephaseid}/assign/byschedule?maxresults=10&scheduleids=&maintainassignments=false&parenttreeid=&includehierarchy=false&isCreateWithLatestVersion=true
{cyclephaseid} - the ID of the cycle phase.
Request header and payload
http://localhost/flex/services/rest/v3/assignmenttree/5/assign/byschedule/?includehierarchy=false&maintainassignments=false&isCreateWithLatestVersion=false&parenttreeid=21 { "ids": [ 11, 12, 13, 14, 15, 16, 17 ] }
maintainassignments - true
or false
. If true
, the test case will be added with assignment. If false
, the test case will be unassigned.
includehierarchy - true
or false
. If true
, the tree structure will be as that in the Test Repository. If false
, the test case will be added to a free-form phase which is in the parent node.
parenttreeid - the tree ID of free-form phase you got in the response upon adding a phase to the cycle.
isCreateWithLatestVersion = true
or false
. If true
, the latest version of the test case will be added. If false
, the test case version that is linked to the test execution will be added.
scheduleids - the execution ID. You will get it in the response upon assigning the test case to a user. Multiple values can be passed as scheduleids=1&scheduleids =2&scheduleids =3
and so on.
Assign the test case to a user for execution.
Use the following operation to assign the test case to a user for execution:
PUT /flex/services/rest/v3/assignmenttree/{cyclePhaseID}/bulk/tree/{tcrCatalogTreeId}/from/-1/to/{UserID}?cascade=true&easmode=2
Request format
To assign a test case to a user, send a PUT request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/assignmenttree/{cyclePhaseID}/bulk/tree/{tcrCatalogTreeId}/from/-1/to/{UserID}?cascade=true&easmode=2
Request body
{ "Add": [ { "id": 2000, "assignmentDate": "2020-07-17", "status": "1", "testerId": -10, "tcrTreeTestcase": { "id": 3999, "tcrCatalogTreeId": 164, "revision": 6, "stateFlag": 0, "lastModifiedOn": 1594991704000, "versionNumber": 1, "createDatetime": 1594991704000, "createdById": 5, "modifiedById": 5, "testcase": { "customProperties": {}, "customProcessedProperties": {}, "id": 1160, "name": "Untitled", "description": "", "lastModifiedOn": 1594991314000, "creationDate": 1594969200000, "createDatetime": 1594991314000, "tcCreationDate": "07/17/2020", "isComplex": false, "estimatedTime": 600, "writerId": 0, "creatorId": 5, "lastUpdaterId": 5, "oldId": 0, "automated": false, "customFieldProcessed": false, "customFieldValues": [], "testcaseSequence": { "seqNumber": 1005 }, "testcaseId": 1005, "versionNumber": 1, "projectId": 6, "testcaseType": "ORIGINAL", "requirementIds": [], "requirementIdsNew": [], "automatedDefault": false, "testcaseShared": false }, "projectId": 6, "releaseId": 12, "isDerivedFromBDD": false, "orderId": 1999, "maxVersionNumber": 1, "projectIdParam": 6, "original": false }, "cyclePhaseId": 6, "lastModifiedBy": 5, "createdById": 5, "lastModifiedOn": 1594991763833, "createDatetime": 1594991763833, "changeBy": 5 }, { "id": 2001, "assignmentDate": "2020-07-17", "status": "1", "testerId": -10, "tcrTreeTestcase": { "id": 4000, "tcrCatalogTreeId": 164, "revision": 6, "stateFlag": 0, "lastModifiedOn": 1594991704000, "versionNumber": 1, "createDatetime": 1594991704000, "createdById": 5, "modifiedById": 5, "testcase": { "customProperties": {}, "customProcessedProperties": {}, "id": 1161, "name": "Untitled", "description": "", "lastModifiedOn": 1594991315000, "creationDate": 1594969200000, "createDatetime": 1594991315000, "tcCreationDate": "07/17/2020", "isComplex": false, "estimatedTime": 600, "writerId": 0, "creatorId": 5, "lastUpdaterId": 5, "oldId": 0, "automated": false, "customFieldProcessed": false, "customFieldValues": [], "testcaseSequence": { "seqNumber": 1006 }, "testcaseId": 1006, "versionNumber": 1, "projectId": 6, "testcaseType": "ORIGINAL", "requirementIds": [], "requirementIdsNew": [], "automatedDefault": false, "testcaseShared": false }, "projectId": 6, "releaseId": 12, "isDerivedFromBDD": false, "orderId": 2000, "maxVersionNumber": 1, "projectIdParam": 6, "original": false }, "cyclePhaseId": 6, "lastModifiedBy": 5, "createdById": 5, "lastModifiedOn": 1594991763834, "createDatetime": 1594991763834, "changeBy": 5 }, { "id": 2002, "assignmentDate": "2020-07-17", "status": "1", "testerId": -10, "tcrTreeTestcase": { "id": 4001, "tcrCatalogTreeId": 164, "revision": 6, "stateFlag": 0, "lastModifiedOn": 1594991704000, "versionNumber": 1, "createDatetime": 1594991704000, "createdById": 5, "modifiedById": 5, "testcase": { "customProperties": {}, "customProcessedProperties": {}, "id": 1162, "name": "Untitled", "description": "", "lastModifiedOn": 1594991315000, "creationDate": 1594969200000, "createDatetime": 1594991315000, "tcCreationDate": "07/17/2020", "isComplex": false, "estimatedTime": 600, "writerId": 0, "creatorId": 5, "lastUpdaterId": 5, "oldId": 0, "automated": false, "customFieldProcessed": false, "customFieldValues": [], "testcaseSequence": { "seqNumber": 1007 }, "testcaseId": 1007, "versionNumber": 1, "projectId": 6, "testcaseType": "ORIGINAL", "requirementIds": [], "requirementIdsNew": [], "automatedDefault": false, "testcaseShared": false }, "projectId": 6, "releaseId": 12, "isDerivedFromBDD": false, "orderId": 2001, "maxVersionNumber": 1, "projectIdParam": 6, "original": false }, "cyclePhaseId": 6, "lastModifiedBy": 5, "createdById": 5, "lastModifiedOn": 1594991763835, "createDatetime": 1594991763835, "changeBy": 5 } ], "Delete": [], "Update": [] }
cyclePhaseId - the ID of the cycle phase you got upon creating the cycle phase.
tcrCatalogTreeId - the ID of the tcrcatalogtree
you got upon creating the cycle phase.
UserId - the ID of the user who will be assigned to the test case.
cascade (boolean) - if true
, the test case will be assigned to the sub-folders as well. If false
, It will be assigned only to the current folder.
The response will be empty.