Forum Discussion

gkres121's avatar
gkres121
New Contributor
3 years ago

Zephyr Jira Cloud API - Update execution

Hi,

I'm trying to update the status and/or comment of a test execution. As recommended through apiary (https://zephyrsquad.docs.apiary.io/#reference/execution/update-execution/update-execution?console=1), I'm doing this through curl, with raw json (--data-binary argument):

curl -s -S -k --include --request PUT -H "Content-Type: application/json" -H "Authorization: JWT ${jwt}" -H "zapiAccessKey: ${ZAPI_ACCESS_KEY}" --data-binary "${data}" https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/execution/${execution_id} --write-out "%{http_code}" 2>&1)
 
With "data" being the json request body (sensitive values redacted) = {"status":{"id":3},"id":"[EXECUTION_ID]","projectId":[PROJECT_ID],"issueId":[ISSUE_ID],"cycleId":"[CYCLE_ID]","versionId":[VERSION_ID],"comment":"Test Comment"}
 
And I'm receiving the following error:

HTTP/2 500
date: Wed, 03 Nov 2021 14:14:13 GMT
content-type: application/json;charset=utf-8
content-length: 134
server: Apache-Coyote/1.1

{"errorType":"ERROR","clientMessage":"We encountered some problems during processing this request. Please try again!","errorCode":104}500

 

I'm also getting this same error when running it in the Production console on apiary. 

 

Up until this point, I've had no issues with GET (for execution lists, cycles, folders, etc.) or POST (creating new folders or tests) requests. Also, the JWT generation and usage has been working fine. If that were the case, I'd expect the "Expecting claim 'qsh' to have value x but instead has the value y" error. So this error is new to me. I've tried every permutation imaginable, I believe I've captured all documented required arguments.

 

Does anything stick out as obviously wrong? The solution for the "Zephyr Cloud API - automated creation of execution" topic had me concerned that it might be a similar documentation error - 

"From the documentation the cycleId is optional in the cloud API, however in the server API the cycleId is mandatory"
https://community.smartbear.com/t5/Zephyr-Squad-Questions/Zephyr-Cloud-API-automated-creation-of-execution/m-p/211313

 

While that topic was referring to creating a new execution using a POST request, it is the same API url and error message. So I wonder if something similar is happening here.

 

Any help would be greatly appreciated, thank you!

Greg

1 Reply

  • fpedroza's avatar
    fpedroza
    Occasional Contributor

    Are you by chance passing the issueKey value (e.g. "XYZ-1234") instead of the issueId value (e.g. "456789")? I ask because that was the cause of an issue I've had.