Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you aim to interact with Xray data, there are a bunch of APIs you can use for different purposepurposes.

But first you need to answer:

...

Although similar, Xray for Jira server/Data Center(DC) and Xray for Jira Cloud are different products, essentially because they are built on top of different infrastructures and application capabilities. Jira server/datacenter and Jira Cloud are distinct products, with different roadmaps, built using distinct technologies, and providing different APIs. This has a consequence that apps for Jira server/DC and for Jira Cloud are essentially totally different from an architecture standpoint, but eventually also from a feature perspective.

The Xray Cloud product closely integrates with Jira Cloud; each one uses their own infrastructure, the first managed by Xray and the later managed by Atlassian.

Xray server/DC provides certain customizations capabilities, which may not be available on Jira Cloud.From an integration standpoint, there will always be changes if a 3rd party wishes to integrate with both Xray server/DC and Xray Cloud. However, these can be subtle, depending on the flow to be implementedworks on top of (i.e., deployed into) Jira server/DC, reusing the Jira server/DC infrastructure.



Info
titleAm I using Jira server/datacenter or Jira Cloud?

??

Available APIs

Xray Cloud 

So, you only know that you're using Jira or Xray but you don't know exactly which "flavour" (i.e., deployment type) you're using.

First, you can ask your Jira administrator. Besides, you can easily check for yourself.


Jira Cloud and Xray for Jira Cloud

If you see a top menu like the following one, having on the top-left corner to switch between Atlassian apps, followed by "Your work", "Filters", ... "Apps", then you are using a Jira Cloud instance.

Image Added

If you click on a project that is using Xray, then the project left side menu will show you a "Testing Board" shortcut (and no Xray Reports, Xray Test Repository, Xray Test Plan Board, or Automated Steps Library). This telld you are using Xray on a Jira Cloud instance (i.e., "Xray Cloud").

Image Added


Jira server/datacenter and Xray for Jira server/datacenter

If you see a top menu like the following one, having on the top-left corner an icon just to go some Jira page (depending on your profile settings),  followed by "Dashboard", "Projects", "Issues", ...,  and then "Tests", then you are using a Jira server/datacenter instance. The "Tests" top menu shortcut only appears if you have Xray (for Jira server/datacenter) installed.

Image Added

If you click on a project that is using Xray, then the project left side menu will show you some options from Xray. Xray Reports, Xray Test Repository, Xray Test Plan Board, and Automated Steps Library are great tips that tell you are using Xray on a Jira server/datacenter instance.

Image Added


Available APIs

There are several APIs that users can take advantage of.

Most users will the REST API provide by Xray to import test automation results during CI/CD. Please have in mind that, in this case, Xray Cloud's REST API is a different API than the Xray server/DC' REST API.

Xray Cloud 

provided bytype of APIversionsauthenticationpurposenotes1JiraREST APIv3

managed by Jira Cloud


API provided bytype of APIversionsURL syntaxauthenticationpurposenotes
1XrayREST APIv1, v2

https://xray.cloud.getxray.app/api/v1/<resource_name>

https://xray.cloud.getxray.app/api/v2/<resource_name>


managed by Xray Cloud

  • API key (i.e., pair of Client Id + Client Secret created by Jira administrator)
  • authentication
  • importing test results
  • importing tests
  • import/exporting Cucumber scenarios
  • backups
This is the most used API, as it used for importing test automation results.
2XrayGraphQLv2https://xray.cloud.getxray.app/api/v2/graphql

managed by Xray Cloud

  • API key (i.e., pair of Client Id + Client Secret created by Jira administrator)


Note: to make GraphQL requests, an initial REST API call needs to be made to the authentication endpoint

  • CRUD operations for Xray entities, with access to all data, including creation of tests
  • obtain Xray entities and other entities related to them, and manage these associations
  • export test results

This API cannot be used to import test automation results.

This API is more advanced and usually only required whenever implementing some custom scenarios.

3JiraREST APIv3

https://<site_url>/rest/api/3/<resource_name>


Note: <site_url> can be something like <xxx>.atlassian.net or it can be your own domain, in case you have it defined for your Jira cloud instance.

managed by Jira Cloud

  • basic authentication, OAuth 2.0
  • standard CRUD operations on Jira entities, including Jira issues (which includes Xray issue based entities)

This API does not provide ways of accessing/modifying internal Xray data, such as test steps, for example.

2

Xray server/DC

...

managed by Xray Cloud

  • API key (i.e., pair of Client Id + Client Secret created by Jira administrator)

...

  • authentication
  • importing test results
  • importing tests
  • import/exporting Cucumber scenarios
  • backups

...

managed by Xray Cloud

  • API key (i.e., pair of Client Id + Client Secret created by Jira administrator)

Note: to make GraphQL requests, an initial REST API call needs to be made to the authentication endpoint



API provided bytype of APIversionsURL syntaxauthenticationpurposenotes
1XrayREST APIv1.0, v2.0

<jira_base_url>/rest/raven/1.0/api/<resource_name>

<jira_base_url>/rest/raven/2.0/api/<resource_name>

managed by Jira server/DC

  • importing test results
  • import/exporting Cucumber scenarios
This is the most used API, as it used for importing test automation results.
2

...

  • CRUD operations for Xray entities, with access to all data, including creation of tests
  • obtain Xray entities and other entities related to them, and manage these associations
  • export test results

...

Xray server/DC

1
provided bytype of APIversionsauthenticationpurposenotesJiraREST APIlatest<jira_base_url>/rest/api/latest/<resource_name>

managed by Jira server/DC

  • standard CRUD operations on Jira entities, including Jira issues (which includes Xray issue based entities)
This API does not provide ways of accessing/modifying internal Xray data, such as test steps, for example.2XrayREST APIv1.0, v2.0

managed by Jira server/DC

  • importing test results
  • import/exporting Cucumber scenarios
ways of accessing/modifying internal Xray data, such as test steps, for example.
Info
titlePlease note
  • Xray server/DC doesn't provide a GraphQL API
  • Xray server/DC REST API is different from Xray Cloud REST API; some endpoints may be similar, like for importing test automation results, but there will be differences
  • Xray server/DC doesn't provide API Keys (pair client id + client secret), as it happens with Xray Cloud. Please check instead Personal Access Tokens (since v8.14, for Jira DC only)
Info
titleXray REST API v1 and v2 on Xray server/DC. What are the differences?

Xray The REST API v2.0 for Xray server/DC is an extension to the original v1.0 of the REST API. Therefore, all existing endpoints on v1.0 also exist on v2.0 (even if you don't see that in the docs); you just need to replace the "1.0" by "2.0" on the URL.

Example:

  <jira_base_url>/rest/raven/1.0/api/test/{key}/testexecutions   becomes     becomes   <jira_base_url>/rest/raven/2.0/api/test/{key}/testexecutions

...