jenkinsjenkins-pipelinejirajira-xrayx-ray

Jenkins Xray Integration - Jira Issue Type with wrong character


In my Jennkins pipeline I have a Jira/Xray integration step :

step([$class: 'XrayImportBuilder',        
      endpointName: '/xunit',        
      fixVersion: '1.0',        
      importFilePath: '/MyFirstUnitTests/TestResults.xml',        
      importToSameExecution: 'true',        
      testExecKey: 'TSTLKS-753',        
      serverInstance: '9146a388-e399-4e55-be28-8c65404d6f9d',        
      credentialId:'75287529-134d-4s91-9964-7h740d8d2i63'])      
                                                                     

Currently I'm having the following error :

ERROR: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"Issue with key \u0027TSTLKS-753\u0027 does not exist or is not of type Test Execution."}

But my issue (TSTLKS-753) is of type "Test Execution":

Test Execution Screenshot

It appears that the string "\u0027" is being added both as a prefix and as a suffix on my issue when building the pipeline.

I've searched for this string and it appears to be a Quotation Mark:

Quotation Mark

I tried out replacing it by double quotes. But I end up with the same error. Also tried to remove them. In any case, if someone already got this error please let me know. Thank you very much


Solution

  • Can you confirm that the user that you have configured in Jenkins for the Xray instance has access to that Jira project where you have your Test Execution issue? Can you try to import it without specifying testExecKey field, with importToSameExecution: 'false', and specifying the projectKey field using something like projectKey: 'TSTLKS' ? If this last option returns an error (e.g. "project does not exist") then it's for sure a permission issue, so you'll either need to use a different Jira user/pass or fix the permissions on Jira side.