Hi
I'm a newcomer to XRay.
I'm trying to import test results in JUnit format from DevOps to Jira XRay via REST API.
On the DevOps side I'm executing the following script on a Windows Server and receiving the error 404:
$pair = "namedomain.com:jira-token"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$basicAuthValue = "Basic $base64"
$headers = @{ Authorization = $basicAuthValue }
$fileContent = [IO.File]::ReadAllText('C:\results\test-results.xml');
$fields = @{'appInfo'='{"name": "test","description": "test"}';'uploadFile'=$fileContent};
Invoke-RestMethod -Uri https://companyname.atlassian.net/api/v1/import/execution/junit?testExecKey=SQ-54 -Method Post -Headers $headers -ContentType 'multipart/form-data' -Body $fields;
I don't think that I have an authorization problem because the following command works:
$pair = "namedomain.com:jira-token"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$basicAuthValue = "Basic $base64"
$headers = @{ Authorization = $basicAuthValue }
Invoke-RestMethod -Uri https://companyname.atlassian.net/rest/api/2/issue/SQ-54 -Method Get -Headers $headers
What am I doing wrong with my import command?