jobProgressToken: Jira (Zephyr) Rest API


I am using Jira (Zephyr) rest calls to create Test Cycle and add Tests cases into it. According to information mentioned here if I use this rest call to add tests to Cycle then as a response I will get JobProgressToken. JobProgressToken is nothing but will tell the progress of Test Case addition in Test Cycle.

The JobProgressToken looks like:

{
"jobProgressToken": "0001491864384175-f6f74daa3cce-0001"
}

Now the problem which I am facing is I am not getting any output from this JobProgressToken. I tried firing the GET rest call using the format mentioned but I am getting empty response.

Can somebody please explain how to use this JobProgressToken to get the Progress of my task? I want to verify that the tests which I added to Cycle are added susccessfully or not?

1 answer

Hi Akash

Thanks for your interest in Zephyr.

In general if we get a job progressId and a response 200 it means the API call is done  and that is the success response

The practical case to use this token is in the "Get job Progress Status" API

http://docs.zfjcloud.apiary.io/#reference/jobprogress/get-job-progress-status/get-job-progress-status

You will get the response as attached in screenshot and  by reading the Json response "message" you can confirm if all the tests are added to cycle.

jobprogress.pngThanks

ZephyrSupport

Hello Zephyr Support,

I am trying to create a new cycle based on another cycle with a cloneCycleId. This has worked previously and the new cycle Id is returned in JSON field "id". 

Currently, I am getting this "jobProgressToken", how do I extract the new test cycle id field?

From the documentation, it seems I might have to execute http get: ".../rest/zapi/latest/execution/jobProgress/:jobProgressToken?type=XXXXXXX" to get information, I cannot find what I need to pass for the type parameter??

 

 

Our whole automated test is based on the id being returned by cloning. Now that you changed stuff without informing us How can we move forward??

Hey Francis,

We figured out a workaround with regards to this issue. We were also relying on the "id" field and this change broke our entire process.

To circumvent this issue, we simply make a webservice call to retrieve all the jobs and put them into a list and then we filter it based on name. 

This is the call: "domain/rest/zapi/latest/cycle?projectId=XXXXXXX". From the response that you get, grab the "name" field and check for the name you are looking for and then save the id accordingly (see code below for more details)

 

getReq = new HttpGet (domain + "/rest/zapi/latest/cycle?projectId=" + projectId);
response = httpClient.execute(getReq, localContext);

jsonObj = readJSON(new InputStreamReader(response.getEntity().getContent()));
jsonObj = jsonObj.getJSONArray(versionId).getJSONObject(0);
jsonObj.remove("recordsCount");
Iterator<?> j = jsonObj.keys();

while(j.hasNext()) {
 String key = (String) j.next();
 if(jsonObj.getJSONObject(key).getString("name").contains(cloneName)) {
  clonedId = key;
  logger.info("Cloned Template ID obtained from brute force look up.");
  break;
 }
}
  • clonedName is the name of the test cycle we are looking for
  • clonedId is the filtered id we get back from full list of test cycles.

Hope this helps.

 

Thanks for the help Peter!

I was just hoping zephyr could've given a straight forward solution, especially when the product is not cheap.

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 Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

184 views 0 4
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