Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Importing JUnit XML to XRay using the REST API - "Error assembling issue : Field customfield_11033"

guy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2022

Based on documentation here, I tried to import my JUnit-style XML using the following inputs. curl -H "Content-Type:multipart/form-data" -u mylogin:mypassword -F "file=@output.xml" https://jira.nayax.com/rest/raven/1.0/import/execution/junit?projectKey=TGP&testPlanKey=TGP-25

I used this article to convert my JMeter XML output to JUnit format using XSL. The output is:

output.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
   <testsuite>
      <testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
                time="0.789">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
                time="0.631">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="createNfcTagUsingPOST - Success" time="0.282">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="handleTagDetectionUsingPOST - Success"
                time="0.311">
         <failure>Test failed: code expected to equal /

****** received  : [[[403]]]

****** comparison: [[[200]]]

/</failure>
      </testcase>
   </testsuite>
</testsuites>

The output was:

{"error":"Error assembling issue data: Field \u0027customfield_11033\u0027 cannot be set. It is not on the appropriate screen, or unknown."}

When I looked at a Test in the source-code view in the browser, that field was hidden:

<input type="hidden" name="raven-testexec-test-customFieldId" id="raven-testexec-test-customFieldId" value="customfield_11033"/>

 

So it is simply customFieldId

Now what? 

 

When I looked at a Test Execution in the source-code view and searched for 11033, I did not find it at all.

Other Attempts

I read on XRay's documentation site that one can use the multipart variety of the API, but I get the same result.

curl -H "Content-Type:multipart/form-data" -u login:password -F "file=@output.xml" -F "testInfo=@test_info.json" -F "info=@test_exec_info.json" https://jira.nayax.com/rest/raven/1.0/import/execution/junit/multipart
test_exec_info.json
{
    "fields": {
        "project": {
            "id": "12900",
            "key": "TGP"
        },
        "summary": "Test Execution for JMeter Execution"
    }
}
test_info.json
{
    "fields": {
        "description": "Game Activation"
    }
}

 dcG4R.pngBo9nz.pngAMjCG.pngsfCZ4.png

1 answer

1 accepted

0 votes
Answer accepted
guy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2022

Does anyone have constructive recommendations?  Been several days.  Thanks.

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2022

Hi @guy 

This is a community, not a support service. If you have urgency, it is best to contact the support service of the respective Apps (https://marketplace.atlassian.com/apps/1211769/xray-test-management-for-jira?hosting=datacenter&tab=support).

In this case, the Xray Support (http://Xraysupport.getXray.app).

About the issue you are reporting, the error message states that the custom field with ID 11033 is not present in the screen of the Test Execution or the Test (depending on the issue that you are updating).

Changing to a multipart API will not help because the issue is with the custom field not being found.

You need to look up the custom fields and check if it exists, and if so, check the screens where the custom field is found. It should be missing on the Test Execution or the Test screens, or both.

If the custom field does not exist in your instance, it should not be used since you should not reference a custom field that does not exist. If you are using the documentation examples, please remember that custom fields IDs change from instance to instance, so you cannot assume that it will have the same ID in your instance.

Thank you.

Kind regards,
Rogerio Paiva [Xray Support Team]

Suggest an answer

Log in or Sign up to answer