Details
Description
Upload of Execution results fails with a NullPointerException.
When upload results to a Test that has an unexpected Test Type (for instance "None"), Xray will return an error.
To reproduce it:
- Import this file to your Jira instance result-2.xml
curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@result-2.xml" http://localhost:8160/rest/raven/1.0/import/execution/junit?projectKey=DAVZ2
- Go to your custom fields configuration http://localhost:8160/secure/admin/ViewCustomFields.jspa and "configure" Test Type
- Edit the options. You have 2 options:
- Delete the Generic option from your context, Jira will warn you about all the Issues that will lose value;
- Another way is to create a new Test Type in the options and change only one of the tests imported to that test type and then only delete this new test type;
- Repeat Step 1. You now have this message as a Response:
{"error":"An exception occurred while handling a v2 REST API request: java.lang.NullPointerException"}
- Check the atlassian-jira.log
2021-09-23 18:15:30,137+0100 http-nio-8160-exec-11 ERROR admin 1095x258577x1 4n81pk 0:0:0:0:0:0:0:1 /rest/raven/1.0/import/execution/junit [c.x.r.rest.a.a] An exception occurred while handling a REST API request: java.lang.NullPointerException at com.xpandit.raven.rest.api.helper.impl.RequestValidationHelperImpl.a(Unknown Source) at com.xpandit.raven.rest.api.helper.impl.RequestValidationHelperImpl.a(Unknown Source) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)