Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Import execution results success in Gitlab but TestExecution type with results not displayed in JIRA

Hima.sindhu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2022

Hi,

I am running a set of test cases in Gitlab pipeline and have added a python file as below to upload the test results to JIRA.

import requests

CLIENT_ID="**********"
CLIENT_SECRET="***********"

response = requests.post("https://xray.cloud.getxray.app/api/v1/authenticate", data={"client_id":CLIENT_ID,"client_secret":CLIENT_SECRET})
access_token = response.json()
headers = {'Content-Type': 'application/xml', 'Authorization' : f'Bearer {access_token}'}
data = open('/builds/digitalxc-qa/digitalxc-appstore-api-test/src/test/java/api-robot/reports/final.xml','r', encoding='utf-8').read().encode('utf-8')
print(headers)
final_res = requests.post("https://xray.cloud.getxray.app/api/v1/import/execution/robot?projectKey=DAAT", data=data, headers=headers)
print("final line uploaded")

This is executed successfully in the gitlab pipeline but the results are not uploaded in JIRA -- Test Execution Issue Type is not displayed under Issues

What are the possible causes?? Please guide on the same.

Client ID and secret was generated from Jira settings > Apps > Xray > API Keys

I am the JIRA administrator.

 

1 answer

0 votes
Hima.sindhu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2022

Found the problem. API keys was generated for some duplicate ID. 

Works fine. Thanks

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events