0

I have looked at the ZAPI documentation, and so far I can get the test cycle id and execution id, so I can execute the test case , write the result for test case in Zephyr. However, I have more test steps in the test case. Now I want to write the results of individual test steps into Zephyr(Jira). Can you please provide sample code for the same(Java preferred). Please a sample code would be helpful.

Approach I have till now: (Found on net)

Get the id's of the stepresults(teststep results) by execution ID using the API "/rest/zapi/latest/stepResult" Then using these stepresult Id's we can execute them with PUT request using API "/rest/zapi/latest/stepResult/{id}"

version I am currently using: jira_version:6.3.12 zfj_version:2.5.2 zapi-1.5.0.15001732.obr Thanks, Ahmed

shaik sartaj
  • 49
  • 1
  • 2
  • 5

2 Answers2

1

First, you need to find a test step execution ID and you will get step execution ID by execution ID.

You will get execution ID from below: {{JiraUrl}}/rest/zapi/latest/execution { "issueId": 123455, "versionId": "{versionId}", "cycleId": "123", "projectId": {ProjectId} }

For every issue, there is a different execution ID Extract a value of "id" from the list of executions corresponding to the issue key.

Now, get step id from below: /rest/zephyr/latest/stepResult?executionId={id}

Extract a value of "id"

To change the status of a test step, send a PUT request to /rest/zapi/latest/stepResult/{id} with a JSON body specifying the desired status.

{ "status": 3 }

Status | Value => -1 | Unexecuted , 1 | Pass , 2 | Fail , 3 | WIP , 4 | Blocked

SoulTechie
  • 11
  • 2
0

You need to start the execution and run the navigator ap: https://jira/rest/zapi/latest/execution

https://jira/rest/zapi/latest/execution/navigator/{{execid}}?zql=fixVersion = 'API'&offset=0&maxrecords=0&expand=executionStatus,checksteps&_=1416925447577

JerryBringer
  • 150
  • 1
  • 1
  • 8