Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-8086

Upload of Execution results fails with a NullPointerException

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 5.1.0
    • 5.1.1
    • Core
    • XRAY 2021 Sprint 18, XRAY 2021 Sprint 19

    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:

      1. Import this file to your Jira instance result-2.xml
        1. 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
          
      1. Go to your custom fields configuration http://localhost:8160/secure/admin/ViewCustomFields.jspa and "configure" Test Type
      2. Edit the options. You have 2 options:
        1. Delete the Generic option from your context, Jira will warn you about all the Issues that will lose value;
        2. 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;
      3. 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"}
      1. 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)
        

      Attachments

        1. result-2.xml
          3 kB
          Diamantino Campos

        Activity

          People

            dpca Diamantino Campos
            dpca Diamantino Campos
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: