create a new test case field, then update it with test values

We are creating an automated testing prototype using jira 6.2, zephyr 2.2 and zapi 1.0 on an evaluation jira instance.

This is what I have working:

1- create a project, version and test case on jira. When creating the test case I used the admin drop down to add some additional fields specific to our testing.

2 use zapi to create a test cycle and add that test case to the newly created test cycle

3 - reading test results and use zapi execute to update the test case using the execution id - PASS/FAIL

4 - I would now like to use zapi to update the additional fields that were created during step 1. I have used the zapi/latest/execution/{id}/execution api. I am getting a HTTP 200 OK, response, but I do not see the values getting updated on the test case screen. Is the the correct way to update fields, or is there another approach?

values=simplejson.dumps(results)

url= baseURL + '/rest/zapi/latest/execution/' + execId + '/execute'

request = Request(url, data=values, headers=headers)

request.get_method = lambda: 'PUT'

resp = urlopen(request).read()

2 answers

The JSON data looks like this -

JSON RESULTS {"status": "1", "skipped": "0", "passed": "9", "finished-at": "2014-03-24T22:14:53Z", "testname": "Gradle", "failed": "0", "duration-ms": "44", "startsat": "2014-03-24T22:14:52Z", "testtotal": "9", "Description": "description ongoing for now"}

Hi Jan,

Fields in the base Test issue will need to be updated using JIRA's REST API. ZAPI Only deals with Zephyr for JIRA-specific entities such as Test Steps, Cycles, and Executions. Basic fields in the test issue do not fall under this umbrella.

The URI you are using 'zapi/latest/execution/{id}/execution' is only used to update the execution of a single sheduled execution in a cycle.

The JIRA REST API for updating an issue is:

https://docs.atlassian.com/software/jira/docs/api/REST/latest/#d2e3625

Regards,

Daniel

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

442 views 6 11
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you