Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,335
Community Members
 
Community Events
176
Community Groups

Xray: Results Import Task fails with Status:400 Response:{"error":"components: components"}

I use Xray for JIRA Jenkins Plugin to upload test results to Jira  as a post-build action

Console output in Jenkins provides error below:

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:17 min
[INFO] Finished at: 2021-06-28T19:21:23Z
[INFO] ------------------------------------------------------------------------
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/target/surefire-reports/testng-results.xml
Saving reports...
Processing '/data/jenkins/home/jobs/tests/builds/4/testng/testng-results.xml'
TestNG Reports Processing: FINISH
Starting XRAY: Results Import Task...
##########################################################
####     Xray is importing the execution results      ####
##########################################################
File found: /var/lib/jenkins/workspace/tests/target/surefire-reports/testng-results.xml
Starting to import results from testng-results.xml
ERROR: Step ‘Xray: Results Import Task’ failed: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"components: components"}
Finished: FAILURE

 XRay result import task Format: TextNG XML

Project Key: HIS (the name of my Jira project)

1 answer

Hi @Iryna R 

This error means that the Components custom field is not present in your project HIS.

Please edit the fields in the Project Settings and add the Components to your project.

Kind regards,
Rogério Paiva [Xray Support Team]

Hi @Rogério Paiva - Xray Xporter . I get the same error (not from jenkins, but from Postman) :

{"error":"components: components"}

I see that, in the JIRA ticket with the feature that in the end generates my json (the one with the results), I have a "Component" custom field with a value. I guess this mean I already have "Components" added to my project.

I`m using this method (Xray for Jira Sever): https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-CucumberJSONresults

and I don´t see in the example input any "Component" field, so I don't understand where the problem is... Am I missing something? Thanks!

Hi @Pedro Garcia Sanchez 

Would you please add a screenshot of the "Component" custom field with a value?

If you don't want to show your information here, please reach out to the Xray Support (http://xraysupport.getxray.app) to share your configuration so that the support team can troubleshoot the cause.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Hi, @Rogério Paiva - Xray Xporter . I finally resolved this problem by using the "Cucumber JSON results Multipart" endpoint, which requires one json with the results and another one with the info of the field(s) that is required and the project ID, like this:

 

{
  "fields": {
    "project": {
      "id""ID of my project"
  },
  "summary""Cucumber Test Execution",
      "components" : [
          {
          "name":"Name of my component"
          }
      ]
  }
}
I've seen in the example of the doc that you can add more info, like the issuetype, custom fields...
Thanks!

Hi @Pedro Garcia Sanchez 

Excellent! Great news!

Yes, indeed, the multipart is a good alternative when you have mandatory fields.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Suggest an answer

Log in or Sign up to answer