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

Not able to import Playwright test jnuit report to Xray's test plan

Shiv Jirwankar August 12, 2024

Scenario:

I want to upload the test results to Xray's test plan ticket. For that, I am using `@xray-app/playwright-junit-reporter` to generate junit reporter XML compatible with Xray.

Now, I want to import this `results.xml` file to test plan on my Jira project. 

I am using this curl command for that:

curl -i -H "Content-Type: application/xml" -X POST -H "Authorization: Bearer <My_Token>" --data @"test-results\results.xml" "<My-Jira-Project-Base-Url>/rest/raven/2.0/import/execution/junit?projectKey=<MyProjectKey>&testPlanKey=<MyTestPlanKey>"

 

We have Jira Datacenter here. Let me know if there's any issue request command here. I am confused with Project ID here as well. I have a numeric id as well of the project. Should I use the projectKey which we see on the URL? eg: if the URL is:
`https://<JIRA-BASE-URL>/browse/<PROJECT-NAME>`

then I am using PROJECT-NAME as my project key. 

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Francisco Fonseca _Xray_
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.
August 12, 2024

Hi @Shiv Jirwankar 

Welcome to the community!

We see 2 possible causes for the issue at hand: 

  1. "Content-Type: application/xml" --> should be "Content-Type: multipart/form-data"
  2. "Authorization: Bearer <My_Token>" --> should be  "-u admin:admin" as in the login and password for the user looking to login.

I hope it helps and keep us posted! Please let us know which error was presented if it does not work.

Best, Francisco

Shiv Jirwankar August 12, 2024

@Francisco Fonseca _Xray_ thank you for looking into this. `results.xml` contains content in XML, not sure if changing content type to multipart/form-data will help here. 

And I am on my office's Jira network, so we don't have a username and password for jira, we do so login. 

Shiv Jirwankar August 12, 2024

I tried with "Content-Type: multipart/form-data", got this error:

{
    "error": "org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found"
}
I guess something wrong with the command here
Francisco Fonseca _Xray_
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.
August 12, 2024

Hi @Shiv Jirwankar

The best way to assist you further would be through our support channels here.

Best, Francisco

TAGS
AUG Leaders

Atlassian Community Events