0

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

hakamairi
  • 4,464
  • 4
  • 30
  • 53
  • Hi, 1) can you please share a screenshot of that issue in Jira? 2) can you confirm that the user that you have configured in Jenkins for the Xray instance has access to that Jira project? 3) can you try to import it without specifying testExecKey field, with importToSameExecution: 'false', and specifying the projectKey field using something like projectKey: 'TSTLKS' ? – Sérgio Dec 01 '22 at 19:31
  • 4) this should be first question :) , are you using Xray on Jira server/datacenter or Xray for Jira cloud? – Sérgio Dec 01 '22 at 19:38
  • Hello @Sérgio, thank you very much for your answers. 1) Regarding the screenshot of the issue in jira, it's attached to this post, under the name "Test Execution Screenshot" 2) I confirm that the user does have access to the project now 3) I tried it out and get the error : ERROR: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"Project does not exist."} 4) Data Server Instance. Thank you a lot for your elaborated answers :) – Claudia Martins Dec 02 '22 at 10:47
  • The fact that it says the project doesn't exist tells me that it's a permission issue – Sérgio Dec 02 '22 at 11:23
  • You were right @Sérgio!! very sorry, I was using the wrong project and the user did not have permissions :S Can you please post this as an answer so I can state this issue is answered and you get the 'answered flag ' :) Thank you a lot for your help !! – Claudia Martins Dec 02 '22 at 11:32
  • Will do later today . – Sérgio Dec 02 '22 at 11:35

1 Answers1

0

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.

Sérgio
  • 1,777
  • 2
  • 10
  • 12