Where to find TR3_ID to call Test plan API?

Anubhavkumar Singh January 23, 2025

I am trying to get API of Test plan in XRAY using postman but I am getting 404 error. I have filled issue ID as TR3_ID but it is not working. I have gone through the API document provide by atlassing but not able figure out.

2 answers

0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2025

Hi  @Anubhavkumar Singh 

It´s kinda hard to follow as you are using different/confusing terminology. You kinda mixing up test, test execution, test set and test plan.

Therefore I would reccomend to first go through xray documentation to know about the general concepts and terminology:

https://docs.getxray.app/display/XRAY31/Terms+and+Concepts

 

test is only a documentation of reproducable steps that need to be done whenever a test is executed.

Every time a test should be executed (eg. per build or version or environment) a test execution should be created. A test execution ISSUE encapsulates the executable instances of the (earlier described) tests. But within the test execution issue these entities are no longer the test but instances of the test issue called Test Run.

 

So I guess what you are trying to manipulate is a Test Run´s status. Nevertheless I recommend to create a new Test Execution issue for each external execution of the tests.

 

Furthermore:

please share everything you have tried so far:

  • which api call did you execute?
  • what was the expected result?
  • what is the functional, step-by-step use case?
  • please also share screenshots of your issues if this describes things better

 

Thanks in advance.

 

Best
Stefan

 

 

 

 

Anubhavkumar Singh January 24, 2025

Hello Stefan,

 

Our main intention is to update individual test run (within an test execution) status as pass, fail with evidence from our CI/CD/CT tools in Test Execution. We have a test computer, which is able to get the test cases on Gherkin (cucumber) from Xray. However, we are not able to update the individual test run status with evidence in Test Execution issue type. Could you please point us to the right resource?


Context: We are writing Python app to update the Test Run status after each run of the tests in a Test Execution. 

Note: If this is not the correct approach to track testing status automatically with traceability mapping back to Xray - please let us know some more details.

 

Furthermore:

please share everything you have tried so far:

  • which api call did you execute?
  • what was the expected result?
    • Test Run status shall be updated as per imported .json data
  • what is the functional, step-by-step use case?
    • Step1: Created issue type Test
    • Step2: Created issue type Test Set
    • Step3: Created issue type Test Execution
    • Step4: Importing generated .json report into Test Execution using above mentioned API.
    • Step5: Checking status of Test Run whether it is updated as per generated .json report
  • please also share screenshots of your issues if this describes things better
    • I have not capture the screen shot, I will share this later.
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2025

Hi @Anubhavkumar Singh 

1. Please share your whole api-request like you would call it in postman or any other tool (with all options and parameters) as well as the whole error message, everything you have in details for analyse.

2. Are you able to execute any other api call with the same user/authentication? The xray rest api takes use of jira´s personal access tokens and bearer token that needs to be created up front. Did you follow the instruction from the documentation?

Personal Access Token:
https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Authentication:
https://docs.getxray.app/display/XRAY760/REST+API

3. TBH unfortunately I´m not deeply familiar with cucumber and importing/exporting test results even though I´m a former QA engineer and at least understand the context and terminology. As far as I could read in the documentation cucumber tests in xray need a special workflow (like either writing the tests in jira xray and exporting a .feature file or the other way round). As far as I understood this is necessary to even be able to connect/map test results to existing tests. Did you follow these instructions?

https://docs.getxray.app/pages/viewpage.action?pageId=133597373#TestinginBDDwithGherkinbasedframeworks(e.g.Cucumber)-Workflows

 

Thanks in advance.

Best
Stefan

 

 

0 votes
Marc - Devoteam
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.
January 23, 2025

Hi @Anubhavkumar Singh 

What API are you using?

To get xray items, you need to use the xray API, https://docs.getxray.app/display/XRAYCLOUD/REST+API 

Anubhavkumar Singh January 23, 2025

I am using same link for API.

I am able to see the Cucumber test with the API & I am facing issue to call Test Set.

We want to fetch test details, we are able to do cucumber but other details are not available to fetch. Can you point us where to get this details

 

Marc - Devoteam
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.
January 23, 2025

Hi @Anubhavkumar Singh 

As you can see there is no endpoint for calling a test set on the Xray api.

As a Test Set is basically an issue in Jira, you should be able to use the Jira API to call the Test Set issue

Anubhavkumar Singh January 23, 2025

Hello Marc, 

Our main intention is to update individual test's (within an test execution) status as pass, fail with evidence from our CI/CD/CT tools. We have a test computer, which is able to get the test cases on Gherkin (cucumber) from Xray. However, we are not able to update the individual test status with evidence. Could you please point us to the right resource?

Context: We are writing Python app to update the test status after each run of the tests in a Test Execution. 

Note: If this is not the correct approach to track testing status automatically with traceability mapping back to Xray - please let us know some more details. 

Regards

Marc - Devoteam
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.
January 24, 2025

Hi @Anubhavkumar Singh 

Issues made by Xray in the system are simply Jira issues based on specific issue types.

So to approach these, (Test, Test execution, Test Set, Test Plan) you need to use the default Jira API

But I think you are referring to the status of a test execution.

You might find answers here, xray-code-snippets 

Suggest an answer

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

Atlassian Community Events