Details
-
Suggestion
-
Status: New
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Currently, Xray’s GraphQL API provides the addDefectsToTestRun mutation to associate defects with test executions. However, there is no GraphQL mutation to create the defect itself. Since defects are Jira issues, this forces users to call Jira’s REST API separately using a different set of credentials. This creates unnecessary complexity in automation workflows and credential management.
- GraphQL Mutation Available - A new createDefect mutation is available in the Xray GraphQL schema.
- Defect Fields Configurable - The mutation accepts configurable fields, including (at minimum):
- projectKey
- issueType
- summary
- description
- customFields (optional)
- Jira Issue Created - The mutation creates a Jira issue of the specified defect type using the Xray credentials (Client ID + Secret).
- Response Contains Issue Key - The mutation response includes the created issue’s key (e.g., DEF-123) and issue ID.
- Validation and Errors - If required fields are missing or invalid, the mutation returns a descriptive validation error.
- Permissions Respected - Only users/projects with permission to create Jira issues via the Xray API can use the mutation.