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 plugin for jenkins not uploading testing result to Jira Edited

When jenkins build is completed and test execution is completed , Zephyr for Jenkins trying to update the maven sure fire report to Jira. But getting below error. Can you please sugges what  is missing here

[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 1ERROR: Build step failed with exception
org.json.JSONException: JSONObject["jobProgressToken"] not found.
	at org.json.JSONObject.get(JSONObject.java:473)
	at org.json.JSONObject.getString(JSONObject.java:654)
	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.assignTests(TestCaseUtil.java:315)
	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:641)
	at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:101)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1840)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Build step 'Publish test result to Zephyr for JIRA' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE

3 answers

Encountering same issue. Have this issue resolved?

Encountering same issue. Have this issue resolved?

I have the same issue and I figure out what was wrong for my JIRA installation.

This has to do with issue field configuration within the project you try to upload the test results to.

When you create an issue in the JIRA project does it require anything other than the summary field? For example, in our project it requires Component/s and Priority field set before you can create an issue. This will apply to Test type issue of Zephyr for JIRA as well.

The Zephyr plugin for Jenkins does not understand or have capability to create Test issue in JIRA using additional parameters such as Component/s and/or Priority field. So when it tries to create the Test type issue it will fail. However it does not return the error to the console (or stop) and it just assume the test issue was created correctly in JIRA. It will then try to process the "missing" data which was not there in the first place.

There are two solutions to this problem:

1. Remove the additional field configuration requirement in your JIRA project. Only the summary field should be required when creating an issue.

2. Modify the Zephyr plugin for Jenkins to support additional field configuration when pushing test results.

Option #1 is easy to do but maybe not an acceptable solution due to your project requirement.

Option #2 will require some development work, either Zephyr will have to do it or someone with strong development knowledge to modify the plugin to support this.

 

I am surprise that Zephyr themselves haven't able to figure this out by now. Or maybe they have and just don't care.

I can confirm this, we have the exact same problem/stacktrace. Any solution? 

Yes, as I mentioned in the post. You can do one of the following:

1. Remove the additional field configuration requirement in your JIRA project. Only the summary field should be required when creating an issue.

2. Modify the Zephyr plugin for Jenkins to support additional field configuration when pushing test results. See source code below:

https://github.com/jenkinsci/zephyr-for-jira-test-management-plugin 

 

Obviously #1 option is the easiest, you can create a specific project in JIRA just for Zephyr plugin with only summary field as the only requirement.

Like mzehetmeier likes this
Aries T I'm New Here Sep 26, 2019

Did any one try the solution (particularly Option#1 of creating a dedicated project with Summary field as the mandatory field), and verify that it works ?

Like thiagotrentin likes this
thiagotrentin I'm New Here Friday

I tried to remove all required fields but still getting this error, is there anyone else with this problem?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

274 views 1 2
Join discussion

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