Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,714
Community Members
 
Community Events
184
Community Groups

Zephyr Test Execution Linking Defect via ZAPI

Hi folks ,

I am interating Zephyr via ZAPI in my application. I created test execution and a defect(bug) in jira but could not find any api in ZAPI docs for linking test execution with existing defect with my application.

Is this requirement feasible . If yes and any API exist for acheving this task then help me guys.

Version of ZAPI is :: 2.3.0.23002808

Version of Zephyr is :: 3.3.2.33202813

 

2 answers

Hi Parashar

Thanks for your interest in Zephyr.

You can use the following API resource of updating the execution details to link your defect to the test execution

http://docs.getzephyr.apiary.io/#reference/executionresource/update-execution-details/update-execution-details

For example

 PUT: http://192.168.11.96:8735/rest/zapi/latest/execution/163/execute
{
  "defectList": [
    "PROJ-82"
  ],
  "updateDefectList": "true"
}

where "163" is the execution id and "PROJ-82" is the defect key

Let us know if you have any queries about the above mentioned

Thanks

ZephyrSupport

I've managed to update de Execution Status using the following REST Call

Http-Method: PUT
Endpoint: /rest/zapi/latest/execution/38/execute
{
    "status": "1"
}

But It fail when I want to link a defect to this execution:

Http-Method: PUT
Enpoint: /rest/zapi/latest/execution/38/execute
{
  "defectList": [
    "YIS-1"
  ],
  "updateDefectList": "true"
}

>>> Response:
Http-Status: 500 Unknown

This is part of the RAW response that may help to find out what the problem is


<status>
    <status-code>500</status-code>
    <message>Unexpected character ('â' (code 226)): was expecting double-quote to start field name
 at [Source: org.apache.catalina.connector.CoyoteInputStream@1b60e5d1; line: 2, column: 2]</message>

 

Regards

Make sure you're sending the body as json. Even if it's the same format, you need to pass it as json or it gives that error. 

Hi Team, 

Any update on this issue. As suggested, I am sending the body as json but getting the same error.

Thanks & Regards
Karanbir

Do you have multiple defects? This is roughly what I use.

    # Multiple defects
if
"," in defect:
defect = defect.strip("| ")
body = {
"defectList": defect.split(","),
"updateDefectList": 'true',
"status": int(status_number)
}
# Single defect
else:
body
= {
"defectList": [defect],
"updateDefectList": 'true',
"status": int(status_number)
}

body
= json.dumps(body)
r = requests.request("PUT", url, headers=headers, data=body)
0 votes
Lakshay
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2023

Hi Guys,

 


You can use the following API resource of updating the execution details to link your defect to the test execution

http://docs.getzephyr.apiary.io/#reference/executionresource/update-execution-details/update-execution-details

But this API is only updating the Status.


The working solution for this problem:

Request URL - PUT {Base URL}/rest/zapi/latest/execution/{Execution Id}/execute

Request Body -

{

  "updateDefectList": "true",
  "defectList": ["{Defect Name}"]
}

 

* Just need to place "updateDefectList" above the "defectList" in all above solutions *


Example Shown above:

Http-Method: PUT
Enpoint: /rest/zapi/latest/execution/38/execute
{

    "updateDefectList": "true",
  "defectList": [
    "YIS-1"
  ]
  


Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events