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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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 ::

Version of Zephyr is ::


1 answer

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

For example

  "defectList": [
  "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



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": [
  "updateDefectList": "true"

>>> Response:
Http-Status: 500 Unknown

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

    <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>



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

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

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

= json.dumps(body)
r = requests.request("PUT", url, headers=headers, data=body)

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you