---
title: "Improve Your Testing Flows with VS Code, AI, and Xray"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/1255047170/Improve%20Your%20Testing%20Flows%20with%20VS%20Code%2C%20AI%2C%20and%20Xray"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Overview

> ℹ️ [VS Code](https://code.visualstudio.com/) is an IDE evolving quite fast, namely the AI capabilities it provides. Therefore, please consider these instructions as a guide that you’ll need to adapt to meet your needs and the version of VS Code you have.
> ℹ️ 
> ℹ️ We don’t provide support for VS Code nor for the instructions provided here, nor are we responsible whatsoever for the results you may obtain using them. Use them wisely, at your own risk.

VS Code (Visual Studio Code, also known as “Code”) is a powerful open-source IDE with built-in AI capabilities. It can be used as an editor for different programming languages, such as Java, Python, Typescript, among others.

The IDE can run locally or through the web.

Among others, VS Code features include:

- Version control integration.
- Run, debug, and test code.
- Integrated terminal.
- Integration with MCP servers.
- Plugins, to add new capabilities like supporting specific languages and previews.
- AI features:
  - Smart auto-complete/suggestions.
  - Explaining the code.
  - Generation of Tests.
  - Implementation and refactoring of code.
  - Asking questions about the code, using chat.
  - Interacting with the code base, with agents.
  - Local or remote agents.
  - LLM model selection.
  - …

VS Code, as an AI-enabled code editor, acts as an expert on the codebase.

We’ll see ahead how to make the most out of VS Code, boosted by its AI capabilities, and the integration with Xray to enable use cases for developers, Test automation engineers, SDETs, right from their favorite IDE.

# Operations

## Leveraging AI Capabilities in VS Code

AI can be used in VS Code to assist users by providing meaningful feedback, implementing tasks, implementing and reviewing code, explaining and documenting it, generating Tests, etc. With AI, a “simple editor” becomes a powerful tool helping users learn, achieve more, and do so faster.

The default capabilities are great, but are generic; they are not tailored specifically for our code base, nor for the organizational context, nor for all the guidelines that we want to adopt to keep the project we’re working on under control. To be able to do that, we need to tailor AI in VS Code for our needs using different capabilities provided by native GitHub Copilot integration.

> ✅ To customize how AI is used in VS Code to interact with our codebase and external tools, we can use custom instructions, prompt files, custom agents, agent skills, MCP servers, and language models.
> ✅ 
> ✅ For more information about the AI core concepts and customization possibilities, please check the section at the end of this page that provides a high-level summary about the built-in VS Code features.

## Working *Together* with Xray Right from VS Code 

Many teams use Xray for Test management and as a single source of truth in Jira for the overall Testing results related to Work items managed in Jira. In this scenario, developers, SDETs, and DevOps engineers can use Xray almost as a service, interacting with it to achieve certain goals quickly, without losing context, right from their IDE.

The main benefits can be summed up in the following points.

- **Run Tests right from the IDE: **run planned/scheduled Tests without context-switching.

- **Provide better-tailored visualization for Test automation results: **track Test automation results, maintaining their semantics, as your Test automation codebase grows.

- **Gain speed and efficiency, easing the management of your Tests for your team: **facilitate reorganization of Tests in your [Test Repository](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565166) by meaningful criteria, in a very efficient way.

- **Drive your next tasks based on quality insights: **assess readiness awareness right from your IDE, so you can decide what needs to be tackled next.

- **Deliver custom reports: **provide custom reports, in Excel, or as simple images which can be easily forwarded or serve as storable evidence.

## Prerequisites and Setup

The use cases shared in this tutorial require a set of preinstalled tools along with some specific MCP servers.

Prerequisites:

- **VS Code installed**. See the <u>[Visual Studio Code download](https://code.visualstudio.com/Download?ref_product=copilot&ref_type=engagement&ref_style=text)</u> page.
- **Access to Copilot**. To use [GitHub Copilot](https://github.com/copilot) in Visual Studio Code, you need either limited access through Copilot Free or full access through a paid Copilot plan.
- [Configure VS Code for GH Copilot](https://code.visualstudio.com/docs/copilot/setup?ref_product=copilot&ref_type=engagement&ref_style=text).
- A recent version of [Node.js](https://nodejs.org/en) (e.g., 22) installed.
- [Python](https://sembi.atlassian.net/wiki/pages/resumedraft.action?draftId=1393459576&draftShareId=a15736c7-0f54-4642-99ad-1ba4da876e89) (as it will be used by several generated scripts)
- [uv for Python](https://github.com/astral-sh/uv)

## MCP Servers

We’ll use a few MCP servers to be able to achieve the use cases detailed ahead; check the instructions on the respective repositories to know more about their capabilities, dependencies, and how to use. We’ll make use of these MCP servers:

- [mcp-graphql](https://github.com/blurrah/mcp-graphql): (**mandatory** for all use cases in this tutorial) to interact with Xray Cloud using its GraphQL API; this will be core for supporting the use cases in this tutorial.
- [chartjs-mcp-server](https://www.npmjs.com/package/@ax-crew/chartjs-mcp-server): to generate charts as images (e.g., PNG).
- [excel-mcp-server](https://pypi.org/project/excel-mcp-server/): to interact with Excel and its sheets, allowing creation of charts.

In VS Code, edit MCP servers configuration (e.g., using “CMD+shift+P” - Figure 1) .

![Figure 1 - Configuration](media://e5b77381-c4df-4ad6-a683-4b90c5ef512d)


<details>
<summary>Example of configuration (mcp.json)</summary>

```json
{
	"servers": {
		"mcp-graphql": {
			"type": "stdio",
			"command": "npx",
			"args": [
				"mcp-graphql"
			],
			"env": {
				"ENDPOINT": "https://xray.cloud.getxray.app/api/v2/graphql",
				"ALLOW_MUTATIONS": "true",
				"HEADERS": "{\"Authorization\":\"Bearer ${env:XRAY_AUTH_TOKEN}\"}",
				"PATH": "/Users/johndoe/.nvm/versions/node/v22.12.0/bin:/bin"
			}
		},
		"excel-mcp-server": {
			"type": "stdio",
			"command": "uvx",
			"args": [
				"excel-mcp-server",
				"stdio"
			]
		},
		"chart.js-mcp-server": {
			"type": "stdio",
			"command": "npx",
			"args": [
				"@ax-crew/chartjs-mcp-server"
			],
			"env": {
				"PATH": "/Users/johndoe/.nvm/versions/node/v22.12.0/bin:/bin"
			}
		}
	},
	"inputs": []
}
```
</details>


The open-source *mcp-graphql* MCP server doesn’t have or know any specifics about Xray; it allows generic interaction with a GraphQL API and supports schema introspection. 

To use [Xray Cloud’s GraphQL API](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565894), it needs to use an authentication token, though; this token needs to be obtained beforehand by invoking an [Xray Cloud’s REST API specific endpoint](https://docs.getxray.app/space/XRAYCLOUD/44577089/Authentication+-+REST+v2) through some out-of-band process. A good practice would be to invoke the API using a utility such as `curl`, then export the token to an environment variable (e.g., XRAY_AUTH_TOKEN), and then open VS Code from the command line to automatically inherit that environment variable.

Example of script for obtaining the authentication token based on client ID + client secret from Xray:

```shell
curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "32A27E69B0AC4E539C14016437990000","client_secret": "d62f81eb9ed859e11e54356dd8a00e4a5f0d0c2a2b52340776f6c7d6d7000000" }'  https://xray.cloud.getxray.app/api/v2/authenticate
export XRAY_AUTH_TOKEN=...
Code
```

Finally, in VS Code make sure to start the MCP servers (you can do it from the MCP configuration file, for example, see Figure 2 - 1):

![Figure 2 - MCP.png](media://974b1f2b-8f83-4719-b382-3e1c5e3ee47f)

## Sample Skills, Prompts, and Agents

The skills, prompts, and custom agents used in this tutorial are available in a [GitHub repository](https://github.com/Xray-App/xray-code-snippets). 

As mentioned earlier, consider them as a source of inspiration so you can get some ideas, adapt them to your needs, and use them wisely, at your own risk.

### Installing skills

Skills can be installed manually by creating the proper folder and markdown file in your local environment, but they are usually managed using [npx skills](https://github.com/vercel-labs/skills) instead.

**To list available skills:**

```
npx skills add https://github.com/Xray-App/xray-code-snippets --list
```

![Figure 3 - Skills](media://7959f6c1-2efb-42e2-820c-08f397df8dbd)

**To install a specific skill:**

```
npx skills add https://github.com/Xray-App/xray-code-snippets --skill xray-data-extraction
```

### Installing Prompts

To install the provided sample prompts, just copy the intended prompt from the [repository](https://github.com/Xray-App/xray-code-snippets/tree/main/.github/prompts) into your own `.github/prompts` folder. 

### Installing Custom Agents

To install the provided sample agents, just copy the intended agent markdown file from the [repository](https://github.com/Xray-App/xray-code-snippets/tree/main/.github/agents) into your own `.github/agents` folder. 

## Use Cases

In this section, we’ll show some possible use cases for taking advantage of AI capabilities in VS Code to interact with Xray and either obtain information/insights right from the IDE or to manage entities in Xray, to better organize them, for instance. 

These use cases should be considered usage examples; some of them would be eventually better handled by making a script once or a small app to systematically perform the intended goal.

### Organizing and Managing the Test Repository

#### Backing up the Test Repository Folder Structure

- **Goal**: to backup the folder structure, including the reference to the Tests that belong to each folder of the Test Repository of a given Jira Space, to a CSV file.
- **Approach**: skill.

##### Example

```
backup the folder structure of the Test Repository of project BOOK and save it to book.csv file
```


<details>
<summary>Chat output</summary>

```
...
I'll help you backup the folder structure of the Test Repository for project BOOK. Let me first check the xray-data-extraction skill to understand how to extract this information.

Now I'll backup the Test Repository structure for project BOOK. Let me first load the GraphQL tool and then query the data.

Perfect! I have all 63 tests from the BOOK project. Now I'll create the CSV file with the backup of the Test Repository structure.

Successfully backed up the Test Repository structure for project BOOK! The book.csv file contains 63 tests with their issue IDs, issue keys, and folder paths. The structure includes folders like:

/DEMO/RF - Robot Framework tests
/Account - Account-related tests with a subfolder for Password Validation
/Shopping Basket - Shopping basket tests with Checkout subfolder
/Search - Search functionality tests
/Newsletter - Newsletter tests
/Book Actions - Book action tests
/Calculations - Calculation tests
/ - Root level tests
```
</details>


<details>
<summary>Generated CSV file contents</summary>

```
13931,BOOK-267,/DEMO/RF
10673,BOOK-21,/Account
10706,BOOK-54,/
10679,BOOK-27,/Newsletter
10678,BOOK-26,/Newsletter
13935,BOOK-271,/Calculations
10719,BOOK-67,/
10677,BOOK-25,/Shopping Basket/Checkout
13338,BOOK-212,/
10685,BOOK-33,/Search
10709,BOOK-57,/
10674,BOOK-22,/Account
13929,BOOK-265,/DEMO/RF
10681,BOOK-29,/Shopping Basket
13877,BOOK-254,/DEMO
10684,BOOK-32,/Search
13431,BOOK-233,/
11382,BOOK-95,/
10716,BOOK-64,/
13865,BOOK-242,/
13879,BOOK-256,/DEMO
11357,BOOK-71,/
10689,BOOK-37,/Account/Password Validation
10704,BOOK-52,/
10683,BOOK-31,/Shopping Basket
13339,BOOK-213,/
10675,BOOK-23,/
14480,BOOK-288,/
10720,BOOK-68,/
13420,BOOK-222,/
10671,BOOK-19,/Account
10701,BOOK-49,/
10721,BOOK-69,/
10707,BOOK-55,/
13930,BOOK-266,/DEMO/RF
11356,BOOK-70,/
10682,BOOK-30,/Shopping Basket
11662,BOOK-204,/
13934,BOOK-270,/Calculations
10703,BOOK-51,/
10676,BOOK-24,/Shopping Basket/Checkout
10702,BOOK-50,/
13926,BOOK-262,/
13872,BOOK-249,/DEMO
10688,BOOK-36,/Book Actions
10718,BOOK-66,/
10715,BOOK-63,/
13933,BOOK-269,/Calculations
10686,BOOK-34,/Search
10708,BOOK-56,/
13928,BOOK-264,/DEMO/RF
10687,BOOK-35,/Shopping Basket/Checkout
13323,BOOK-209,/
10690,BOOK-38,/Account/Password Validation
10710,BOOK-58,/
10711,BOOK-59,/
13870,BOOK-247,/DEMO
10680,BOOK-28,/Book Actions
10700,BOOK-48,/
13395,BOOK-219,/
10672,BOOK-20,/Account
10705,BOOK-53,/
10717,BOOK-65,/

```
</details>

#### Restoring the Test Repository Folder Structure

- **Goal**: to restore the folder structure, including the reference to the Tests that belong to each folder of the Test Repository of a given Jira Space from a CSV file.
- **Approach**: skill.

##### Example

```
restore folder structure backup for Test Repository of project BOOK in Xray from file book.csv
```


<details>
<summary>Chat output</summary>

```
...
✅ Test Repository folder structure successfully restored for project BOOK!

Summary:

Root folder (/): 33 tests
12 subfolders created with tests organized:
/Account: 4 tests
/Account/Password Validation: 2 tests
/Shopping Basket: 3 tests
/Shopping Basket/Checkout: 3 tests
/Search: 3 tests
/Book Actions: 2 tests
/Newsletter: 2 tests
/DEMO: 4 tests
/DEMO/RF: 4 tests
/Calculations: 3 tests
Total: 63 tests successfully placed across the restored folder hierarchy

The backup from book.csv has been fully restored to the Xray Test Repository for the BOOK project.
```
</details>

#### Reorganizing the Test Repository Folder Structure

- **Goal**: to reorganize the Tests of the Test Repository of a given Jira Space in a new folder structure, according to some user-specified criteria, to make management of Tests easier, including their discovery for future operations.
- **Approach**: skill.

##### Example 1

```
suggest a new organization for the Test Repository of project BOOK, based on functionality and components. 
```


<details>
<summary>Chat output</summary>

![Figure 4 - Example](media://6435129c-1219-4f3a-bd6e-07ffc5226f73)
</details>

##### Example 2

```
suggest a new organization for the Test Repository of project BOOK, based on functionality and covered requirements
```

> ℹ️ If you want to actually organize the Test Repository right away, you should change the previous prompt to apply the reorganization.


<details>
<summary>Chat output</summary>

```
Test Repository/
│
├── Account Management/
│   ├── Authentication/
│   │   ├── login bookstore website: BOOK-2/
│   │   │   └── BOOK-19: Test visitors can Login to Book Store Website
│   │   └── logout from account: BOOK-3/
│   │       └── BOOK-20: Test logged in visitors can Logout from their account
│   │
│   ├── Profile Management/
│   │   ├── edit account details: BOOK-4/
│   │   │   ├── BOOK-21: Test a logged in visitor can edit the account details
│   │   │   └── BOOK-22: Test a logged in visitor can edit the default address
│   │   └── change locale: BOOK-5/
│   │       └── BOOK-23: Test a visitor can change his locale
│   │
│   └── Security/
│       ├── password reset procedure: BOOK-15/
│       │   └── BOOK-37: Manual test of password reset procedure
│       └── strong password enforcement: BOOK-17/
│           └── BOOK-38: Manual test of strong password validation
│
├── Search & Discovery/
│   ├── Search/
│   │   ├── search books store: BOOK-8/
│   │   │   ├── BOOK-32: Test single keyword search
│   │   │   ├── BOOK-33: Test multiple keywords search
│   │   │   └── BOOK-34: Test filter search results
│   │   │
│   │   ├── search books website: BOOK-210/
│   │   │   ├── BOOK-213: Exploratory test for search
│   │   │   ├── BOOK-222: Exploratory test for search
│   │   │   └── BOOK-233: Exploratory search test
│   │   │
│   │   └── search books bookstore: BOOK-241/
│   │       ├── BOOK-242: (MT) test for searching books by title
│   │       ├── BOOK-264: Valid Search by book title
│   │       ├── BOOK-265: Valid Search by book description
│   │       ├── BOOK-266: Valid Search by book author
│   │       └── BOOK-267: Search for unexistent book title
│   │
│   └── Browse/
│       ├── browse bookstore discover: BOOK-246/
│       │   ├── BOOK-249: (DDMT) test for browsing bookstore by category
│       │   └── BOOK-262: (MT) test for seeing book details
│       │
│       ├── highlighted books homepage: BOOK-261/
│       │   └── BOOK-247: (MT) test to see highlighted books on homepage
│       │
│       └── navigate book details: BOOK-14/
│           └── BOOK-28: Test visitors can navigate to book details page
│
├── Shopping/
│   ├── Cart Management/
│   │   ├── add books basket: BOOK-10/
│   │   │   └── BOOK-29: Test visitors can add books to shopping basket
│   │   │
│   │   ├── remove books basket: BOOK-11/
│   │   │   └── BOOK-30: Test visitors can remove books from shopping basket
│   │   │
│   │   ├── view basket books: BOOK-12/
│   │   │   └── BOOK-31: Test visitors can view all books in shopping basket
│   │   │
│   │   └── manage shopping cart: BOOK-253/
│   │       ├── BOOK-254: Test ability to update items quantity on cart
│   │       └── BOOK-256: Exploratory shopping cart
│   │
│   ├── Checkout/
│   │   └── checkout items basket: BOOK-6/
│   │       ├── BOOK-24: Test Checkout items in basket
│   │       └── BOOK-25: Test Checkout with incorrect delivery details
│   │
│   └── Ordering/
│       └── order books online: BOOK-211/
│           └── BOOK-212: Exploratory test for adding items to shopping cart
│
├── Newsletter/
│   └── register newsletter: BOOK-7/
│       ├── BOOK-26: Test visitors can signup to newsletter
│       └── BOOK-27: Test visitors can unsubscribe from newsletter
│
├── Calculations/
│   ├── perform calculations: BOOK-268/
│   │   └── BOOK-271: Negative integer addition
│   │
│   └── calculations: BOOK-272/
│       ├── BOOK-269: Simple integer addition
│       └── BOOK-270: Sum of two positive numbers
│
└── Uncovered/
    ├── Robot Demo Tests/
    │   ├── Data Driven: BOOK-48, 49, 50, 51, 52, 53
    │   ├── Keyword Driven: BOOK-55, 56, 57, 58, 59
    │   └── Gherkin: BOOK-54
    │
    ├── Pet Store Tests/
    │   └── BOOK-64, 65, 66, 67
    │
    ├── Other Generic Tests/
    │   ├── BOOK-35: Shopping Basket express checkout
    │   ├── BOOK-36: Favorites List
    │   ├── BOOK-63: Display product details
    │   ├── BOOK-68, 69: Search/Cart tests
    │   ├── BOOK-70, 71: Login tests
    │   ├── BOOK-95: WANImpact Local
    │   ├── BOOK-204: Dummy test
    │   ├── BOOK-209: Pre-order feature test
    │   └── BOOK-288: Login test
    │
    └── Exploratory Tests (Unlinked)/
        └── BOOK-219: Exploratory test for search
        ...
```
</details>


![Figure 5 - Example](media://9fac82a2-2e7f-4564-963a-a2fba9867af6)

#### Cleaning Test Repository Folder Structure Up

- **Goal**: to clean the folder structure of the Test Repository up by removing useless/empty folders.
- **Approach**: skill.

##### Example

```
cleanup Test Repository folder structure of project ST
```

> ℹ️ If you don’t want to actually to clean up right away, you may append the instruction *suggest what what will be done and don't actually do it *to the previous prompt.


<details>
<summary>Chat output</summary>

```
Cleanup Recommendation
No folders need to be deleted.

All folders in the Test Repository are being used:

/UI contains 2 tests directly
/automation and /automation/com.sergiofreire.xray.tutorials.springboot don't have tests directly, but they serve as organizational parent folders for test subfolders that contain a total of 41 tests
The Test Repository is clean and well-organized. There are no empty/useless folders to remove.
```
</details>

### Organizing and Managing Test Plans

#### Reorganizing Automated Tests within Test Plan Board Folder Structure

- **Goal**: to organize automated Tests within the [Test Plan board](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565285) to better analyze Test automation results according to the semantics of automated Tests, making life easier for SDETs and developers .
- **Approach**: custom agent (e.g., xray-automation-organizer).

##### Example 1

```markdown
organize the automated tests in Test Plan ST-3 by package and class; use flat structure with dot-notation package
```


<details>
<summary>Agent output</summary>

![Figure 6 - Example](media://dc293cbc-c6ab-4379-9977-ccfcece794e4)
</details>

![Figure 7 - Example](media://545e2c71-1c7b-4f0d-b93e-213293f0cb31)

##### Example 2

```none
show the new structure for the folder reorganization of the automated tests in Test Plan ST-3 by unit or integration, and then by functionality; separate REST related tests from other tests. Don't actually organize tests, just provide information about the proposed new folder structure
```


<details>
<summary>Agent output</summary>

```
Test Plan ST-3 (33 tests total)
│
├── /unit (22 tests)
│   │
│   ├── /data-layer (6 tests)
│   │   └── /user-repository
│   │       ├── ST-265: findAllReturnsAllUsers
│   │       ├── ST-269: findByIdReturnsUserForValidId
│   │       ├── ST-273: findByIdReturnsNullWhenInvalidId
│   │       ├── ST-276: findAllReturnsAllUsers
│   │       ├── ST-281: findByIdReturnsUserForValidId
│   │       └── ST-285: findByIdReturnsNullWhenInvalidId
│   │
│   └── /service-layer (16 tests)
│       └── /user-service
│           ├── ST-266: getUserDetailsReturnsEmptyIfNonExisting
│           ├── ST-267: getUserByUsernameReturnsUserIfExisting
│           ├── ST-268: getAllUsersReturnsAllExistingUsers
│           ├── ST-270: deleteUserRemovesIt
│           ├── ST-271: existsReturnsFalseIfNonExisting
│           ├── ST-272: getUserByUsernameReturnsEmptyIfNonExisting
│           ├── ST-275: getUserDetailsReturnsUserIfExisting
│           ├── ST-277: existsReturnsTrueIfExisting
│           ├── ST-278: getUserDetailsReturnsEmptyIfNonExisting
│           ├── ST-279: getUserByUsernameReturnsUserIfExisting
│           ├── ST-280: getAllUsersReturnsAllExistingUsers
│           ├── ST-282: deleteUserRemovesIt
│           ├── ST-283: existsReturnsFalseIfNonExisting
│           ├── ST-284: getUserByUsernameReturnsEmptyIfNonExisting
│           ├── ST-286: getUserDetailsReturnsUserIfExisting
│           └── ST-287: existsReturnsTrueIfExisting
│
└── /integration (11 tests)
    │
    └── /rest-api (11 tests)
        │
        ├── /greeting (2 tests)
        │   ├── ST-5: getDefaultGreeting
        │   └── ST-8: getPersonalizedGreeting
        │
        ├── /index-welcome (2 tests)
        │   ├── ST-9: getWelcomeMessage (IndexControllerIT)
        │   └── ST-14: getWelcomeMessage (IndexControllerMockedIT)
        │
        └── /user-management (7 tests)
            ├── ST-6: createUserWithSuccess
            ├── ST-7: deleteUserUnsuccess
            ├── ST-10: listAllUsersWithSuccess
            ├── ST-11: getUserUnsuccess
            ├── ST-12: dontCreateUserForInvalidData
            ├── ST-13: deleteUserWithSuccess
            └── ST-15: getUserWithSuccess
```
</details>

![Figure 8 - Example](media://556555b4-4b95-41e7-b2b3-0555dda19b7c)

##### Example 3

```markdown
show the new structure for the folder reorganization of the automated tests in Test Plan ST-3 by the covered requirement (use a up to 4 word sentence for it); use just a folder name for that and add the prefix of the requirement issue key on it, like "ST-2: landing page access". separate unit tests from all other ones. 
```

> ℹ️ If you don’t want to actually organize the Tests right away, you may append the instruction  *Don't actually organize tests, just provide information about the proposed new folder structure* to the previous prompt.


<details>
<summary>Agent output</summary>

```
Based on the analysis of Test Plan ST-3 and the covered requirements, here's the proposed folder structure organized by covered requirement with requirement key prefixes:

Proposed Folder Structure
Test Plan ST-3 (33 tests total)
│
├── /unit (22 tests)
│   │
│   └── /no-requirement (22 tests)
│       ├── /user-repository (6 tests)
│       │   ├── ST-265: findAllReturnsAllUsers
│       │   ├── ST-269: findByIdReturnsUserForValidId
│       │   ├── ST-273: findByIdReturnsNullWhenInvalidId
│       │   ├── ST-276: findAllReturnsAllUsers
│       │   ├── ST-281: findByIdReturnsUserForValidId
│       │   └── ST-285: findByIdReturnsNullWhenInvalidId
│       │
│       └── /user-service (16 tests)
│           ├── ST-266: getUserDetailsReturnsEmptyIfNonExisting
│           ├── ST-267: getUserByUsernameReturnsUserIfExisting
│           ├── ST-268: getAllUsersReturnsAllExistingUsers
│           ├── ST-270: deleteUserRemovesIt
│           ├── ST-271: existsReturnsFalseIfNonExisting
│           ├── ST-272: getUserByUsernameReturnsEmptyIfNonExisting
│           ├── ST-275: getUserDetailsReturnsUserIfExisting
│           ├── ST-277: existsReturnsTrueIfExisting
│           ├── ST-278: getUserDetailsReturnsEmptyIfNonExisting
│           ├── ST-279: getUserByUsernameReturnsUserIfExisting
│           ├── ST-280: getAllUsersReturnsAllExistingUsers
│           ├── ST-282: deleteUserRemovesIt
│           ├── ST-283: existsReturnsFalseIfNonExisting
│           ├── ST-284: getUserByUsernameReturnsEmptyIfNonExisting
│           ├── ST-286: getUserDetailsReturnsUserIfExisting
│           └── ST-287: existsReturnsTrueIfExisting
│
└── /integration (11 tests)
    │
    ├── /no-requirement (3 tests)
    │   ├── ST-5: getDefaultGreeting
    │   ├── ST-8: getPersonalizedGreeting
    │   └── ST-9: getWelcomeMessage (IndexControllerIT)
    │
    ├── /ST-1-access-landing-page (1 test)
    │   └── ST-14: getWelcomeMessage (IndexControllerMockedIT)
    │
    └── /ST-2-manage-users-API (7 tests)
        ├── ST-6: createUserWithSuccess
        ├── ST-7: deleteUserUnsuccess
        ├── ST-10: listAllUsersWithSuccess
        ├── ST-11: getUserUnsuccess
        ├── ST-12: dontCreateUserForInvalidData
        ├── ST-13: deleteUserWithSuccess
        └── ST-15: getUserWithSuccess
```
</details>

### Reporting

#### Overall Coverage Status

- **Goal**: to provide information about the overall requirement coverage status for a Space with a given release based on the Testing results for that release.
- **Approach**: custom prompt.

##### Example

```none
/coverage BOOK
```

![Figure 9 - Example](media://9186a2c5-0f93-43bd-a8b4-727d10aa4e21)

#### Test Plan Progress

- **Goal**: to provide information about the overall, consolidated progress of a [Test Plan](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565153) based on its results.
- **Approach**: custom prompt.

##### Example

```
/testplan ST-3
```

![image-20260227-175624.png](media://01aefc42-089b-4fbb-97cd-1ac6a30ac539)


#### Overall Coverage Chart as an Image

- **Goal**: to provide information about the overall requirement coverage status for a Space with a given release based on Testing results for that release, visually represented as a stacked bar chart
- **Approach**: skills.
- **MCP servers: **[chartjs-mcp-server](https://www.npmjs.com/package/@ax-crew/chartjs-mcp-server)

##### Example

```
get all requirements for project BOOK and make a horizontal stacked bar chart save
as coverage.png, where the y axis corresponds to the Priority and the x axis represents the requirement count according to their coverage status
```


> …
> 
> **Summary of findings:**
> 
> - **Highest priority**: 1 requirement (1 NOK)
> - **High priority**: 1 requirement (1 OK)
> - **Medium priority**: 27 requirements (4 UNCOVERED, 15 OK, 8 NOK)
> 
> The chart uses the standard Xray color scheme: blue for <span style="color: #0747a6">UNCOVERED</span>, green for <span style="color: #36b37e">OK</span>, and red for <span style="color: #ff5630">NOK</span> status (Figure 11).

![Figure 11 - Chart.png](media://7bc7f9bd-06b1-4727-917d-f3b124a6f895)

#### Test Runs Count by Status, as a Chart Image

- **Goal**: based on the [Test Runs](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565109) for a given release, generate a pie chart image based on their statuses (Figure 12).
- **Approach**: skills.
- **MCP servers: **[chartjs-mcp-server](https://www.npmjs.com/package/@ax-crew/chartjs-mcp-server)

##### Example

```
get all Test Runs for project CALC on version v2.0 and create a pie chart for the test runs based on their status and save it as chart.png
```

![Figure 12 - Chart](media://6268848a-0e7c-42d8-bb8a-085fcb4eb971)


#### Test Runs Count by Status and Pie Chart in Excel 

- **Goal**: based on the Test Runs for a given release, generate an Excel file with a pie chart based on their statuses (Figure 13).
- **Approach**: skills.
- **MCP servers: **[excel-mcp-server](https://pypi.org/project/excel-mcp-server/)

##### Example

```
get all Test Runs for project CALC on version v2.0 and In Excel, on a file named chart.xlsx (overwrite it if needed), create a pie chart for the test runs based on their status
```

![Figure 13 - Chart](media://503f4ed5-5c5a-44a2-82ba-03be09228e78)

### Automation

#### Run Automated Tests in a Test Plan or Test Execution

- **Goal**: based on the Tests from an existing Test Plan or [Test Execution](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565117), run the corresponding automated Tests using [Maven](https://maven.apache.org/).
- **Approach**: skills.

> ℹ️ In this use case, we’re assuming Test automation results were already uploaded once, so that Test Work items were provisioned in Xray as “generic” Tests. Those “generic” (i.e., unstructured) Tests have a definition that acts as a unique identifier for the corresponding implementation on the Test code, usually based on the related class name and method. These identifiers will be used as a source for the Test runner (surefire, failsafe) invoked by Maven.

##### Example

```
Run the Java automated tests that are in Xray, on Test Execution ST-297
```

![Figure 14 - Example](media://213741ad-82c0-45f1-8e76-428d0b05d980)

## Background on AI features Supported by VS Code

### Core Concepts

You may find a detailed explanation of the concepts of the AI features enabled by GitHub Copilot in the [VS Code documentation](https://code.visualstudio.com/docs/copilot/core-concepts) and an [overview](https://code.visualstudio.com/docs/copilot/overview) of GitHub Copilot in VS Code.

#### Agents

VS Code provides several [built-in agents](https://code.visualstudio.com/docs/copilot/agents/local-agents#_builtin-agents):

- [Agent](https://code.visualstudio.com/docs/copilot/agents/local-agents#_agent): Agent is optimized for complex coding tasks based on high-level requirements that might require running terminal commands and tools. The AI operates autonomously, determining the relevant context and files to edit, planning the work needed, and iterating to resolve problems as they arise.
- [Plan](https://code.visualstudio.com/docs/copilot/agents/planning#_plan-agent-for-detailed-task-research): the plan agent is optimized for creating a structured implementation plan for a coding task… The plan agent uses a 4-phase iterative workflow: **Discovery** (research) → **Alignment** (ask questions) → **Design** (draft plan) → **Refinement** (iterate). Questions are asked through interactive prompts that pause the agent until you respond, ensuring better alignment with your intent before code changes are made.
- [Ask](https://code.visualstudio.com/docs/copilot/agents/local-agents#_ask): the Ask feature works best for answering questions about your codebase, coding, and general technology concepts. Use Ask when you want to understand how something works, explore ideas, or get help with coding tasks.

#### Agent Types

VS Code supports four main [categories of agents](https://code.visualstudio.com/docs/copilot/agents/overview#_types-of-agents):

- **local**: run <u>interactively</u> and directly in VS Code on your machine; examples include the built-in Agent, Plan, and Ask agents.
- **background**: run non-interactively, in the background, on your local machine.
- **cloud**: runs on cloud infrastructure.
- **third-party**: provided by third parties; run on remote infrastructure; examples include Copilot, Codex, and Claude coding assistants.

#### Agent Sessions

An agent session is a persistent conversation with an Agent, usually focused on achieving a certain goal/task using a set of interactions. These can run locally or in the cloud, interactively or in the background.

#### Sub Agents

[Sub Agents](https://code.visualstudio.com/docs/copilot/agents/subagents) are agents that are called by agents to perform a specialized task.

By default, subagents use the same model and tools as the main chat session but start with a clean context window. Subagents don't inherit the main agent's instructions or conversation history. They receive only the task prompt you provide. By running a <u>[custom agent](https://code.visualstudio.com/docs/copilot/customization/custom-agents)</u> as a subagent, you can apply specialized behavior, tools, and models for specific tasks.

#### Custom Agents

[Customs Agents](https://code.visualstudio.com/docs/copilot/customization/custom-agents) are defined using a `xxx.agent.md` file stored in `.github/agents`.

While the built-in agents are generic agents, in the sense that they don’t have specific instructions, with custom agents, we can provide those specific instructions and enumerate the tools that can be available to achieve a certain goal. We can think of custom agents as agents with specific personas having access to a limited set of tools, so they can perform some task.

#### Handoff

A [handoff](https://code.visualstudio.com/docs/copilot/customization/custom-agents#_handoffs) is the process of transferring a session from one agent type to another, carrying over the conversation history. Handoffs are defined in the custom agent file.

#### Skills

[Agent Skills](https://code.visualstudio.com/docs/copilot/customization/agent-skills) are folders of instructions, scripts, and resources that GitHub Copilot can load when relevant to perform specialized tasks. Agent Skills is an <u>[open standard](https://agentskills.io/)</u> that works across multiple AI agents, including GitHub Copilot in VS Code, GitHub Copilot CLI, and GitHub Copilot coding agent.

#### Prompts

[Prompt files](https://code.visualstudio.com/docs/copilot/customization/prompt-files) are a way to have custom, recurrent prompts ready for quick use in the chat while interacting with Agents in agent sessions. 

They are also called “slash commands” because they can be invoked like `/<prompt_name>`.

They’re defined in markdown files like `xxx.prompt.md`. in the  `.github/prompts` folder.

#### Custom Instructions

[Custom instructions](https://code.visualstudio.com/docs/copilot/customization/custom-instructions) are a VS Code-specific feature used to define coding standard, guidelines, architectural decisions, etc. that are applicable to files matching a certain glb pattern (e.g., “**/*.java”).

They’re defined in a file `.github/copilot-instructions.md`.

#### Tools

[Tools](https://code.visualstudio.com/docs/copilot/core-concepts#_tools) are the mechanisms that allow agents to act with the environment, namely the development environment. Tools include:

- [Built-in VS Code tools](https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features#_chat-tools) (e.g., reading/writing files, search, navigating, running Tests and shell commands).
- MCP Server tools: MCP servers provide tools that can be used in the chat or in agents; these include all sort of capabilities.
- Extension tools: tools provided by VS Code extensions.

#### Chat Participants

[Chat participants](https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features#_chat-participants) (e.g., @github,  @terminal, @VS Code, @workspace) handle domain-specific requests in chat. VS Code provides several built-in participants (e.g., @github,  @terminal, @VS Code, @workspace). Chat participants can start MCP servers if they need (e.g., GitHub MCP server).

## Recommendations

- Tailor the instructions, agents, prompts, skills, to your needs; adapt and validate them properly.
- Not every use case makes sense to be addressed using AI every time you need to execute it; some use cases would be better addressed by implementing a script with a systematic algorithm to tackle that specific use case. As an example, making a backup of the Test Repository would be such a use case.

# References

- [https://code.visualstudio.com/](https://code.visualstudio.com/)
- <u>[Visual Studio Code download page](https://code.visualstudio.com/Download?ref_product=copilot&ref_type=engagement&ref_style=text)</u>
- [Set up GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/setup?ref_product=copilot&ref_type=engagement&ref_style=text)
- MCP Servers
  - [https://github.com/blurrah/mcp-graphql](https://github.com/blurrah/mcp-graphql)
  - [https://www.npmjs.com/package/@ax-crew/chartjs-mcp-server](https://www.npmjs.com/package/@ax-crew/chartjs-mcp-server)


> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).