QMetry: Create Defect or Issue
qmetry_create_defect_or_issueCreates a new defect or issue in QMetry to track bugs, enhancements, and link them to test executions for traceability.
Instructions
Create a new defect/issue internally in QMetry.
Toolset: Issues
Parameters:
projectKey (string): Project key - unique identifier for the project (default: "default")
baseUrl (string): The base URL for the QMetry instance (must be a valid URL)
issueType (number) required: Issue type ID (e.g. Bug, Enhancement, etc.)
issuePriority (number) required: Issue priority ID (e.g. High, Medium, Low, etc.)
summary (string) required: Summary or title of the defect/issue
description (string): Detailed description of the defect/issue
sync_with (string): External system to sync with (e.g. JIRA, QMetry, etc.)
issueOwner (number): Owner/user ID for the issue
component (array): Component IDs associated with the issue
affectedRelease (array): Release IDs affected by this issue
affectedCycles (array): Cycle IDs affected by this issue
tcRunID (number): Test Case Run ID to link this defect/issue to a test execution (optional)
Output Description: JSON object containing the new create issue with id, dfid(defectID).
Use Cases: 1. Create a basic defect/issue with just a summary 2. Set issueType, issueOwner, component, and affectedRelease using valid IDs from project info 3. Create defects/issues for automation or manual testing types 4. Link defects/issues to specific test case runs using tcRunID
Examples:
Create an issue with summary 'Login Issue'
{
"name": "Login Issue",
"issuePriority": 2231988,
"issueType": 2231983
}Expected Output: Issue created in summary details
Create an issue with Major priority and Bug type to Bug with summary 'Login Issue'
{
"name": "Login Issue",
"issuePriority": 2231988,
"issueType": 2231983
}Expected Output: Issue created in summary details with priority and Bug type
Create an issue with summary 'Login Issue' and set issueOwner to 'John Doe'
{
"name": "Login Issue",
"issueOwner": 15112,
"issuePriority": 2231988,
"issueType": 2231983
}Expected Output: Issue created in summary details with owner, priority and Bug type
Create an issue with summary 'Login Issue' and link it to test case run ID 567890
{
"name": "Login Issue",
"issueOwner": 15112,
"issuePriority": 2231988,
"issueType": 2231983,
"tcRunID": 567890
}Expected Output: Issue created in summary details and linked to test case run ID 567890
Create an issue with summary 'Login Issue' and set description to 'User is unable to login' and owner to 'John Doe' and link it to test case run ID 567890
{
"name": "Login Issue",
"issueOwner": 15112,
"issuePriority": 2231988,
"issueType": 2231983,
"tcRunID": 567890,
"description": "User is unable to login"
}Expected Output: Issue created in summary details with description, owner, priority, Bug type and linked to test case run ID 567890
Create an issue with summary 'Login Issue' and set release to 'Release 1.0' and its associated all cycles and owner to 'John Doe'
{
"name": "Login Issue",
"issueOwner": 15112,
"issuePriority": 2231988,
"issueType": 2231983,
"affectedRelease": [
111840
],
"affectedCycles": [
112345,
112346
]
}Expected Output: Issue created in summary details with release and associated all cycles, owner
Create an issue with summary 'Login Issue' and set release to 'Release 1.0' and its associated all cycle 'Cycle 1.0.1', 'Cycle 1.0.2'
{
"name": "Login Issue",
"issuePriority": 2231988,
"issueType": 2231983,
"affectedRelease": [
111840
],
"affectedCycles": [
112345,
112346
]
}Expected Output: Issue created in summary details with release and cycles
Hints: 1. CRITICAL: name (summary), issueType, issuePriority are REQUIRED fields to create an issue 2. OPTIONAL: issueOwner, component, affectedRelease, description, tcRunID can also be provided 3. To get valid values for sync_with (igConfigurationID or internalTrackerId), issueType, issuePriority, issueOwner, component, affectedRelease, and tcRunID, call the 'project get info tools' use the following mappings: 4. - sync_with: customListObjs.component[].igConfigurationID or internalTrackerId 5. - issueType: customListObjs.issueType[].id 6. - issuePriority: customListObjs.issuePriority[].id 7. - issueOwner: customListObjs.users[].id 8. - affectedRelease: data[].releaseID 9. - tcRunID: data[].tcRunID (from 'Execution/Fetch Testcase Run ID') 10. If the user provides a issuePriority name (e.g. 'Blocker'), fetch project info, find the matching priority in customListObjs.issuePriority[index].name, and use its ID in the payload. If the name is not found, skip the issuePriority field and show a user-friendly message: 'Defect/issue created without issuePriority, as given issuePriority is not available in the current project.' 11. If the user provides an issueOwner name, fetch project info, find the matching issueOwner in customListObjs.users[index].name, and use its ID in the payload as issueOwner. If the name is not found, skip the issueOwner field and show a user-friendly message: 'Defect/issue created without issueOwner, as given issueOwner is not available in the current project.' 12. If the user provides an issue type name, fetch project info, find the matching type in customListObjs.issueType[index].name, and use its ID in the payload as issueType. If the name is not found, skip the issueType field and show a user-friendly message: 'Defect/issue created without issue type, as given type is not available in the current project.' 13. Release/cycle mapping is optional but useful for planning. 14. If the user wants to link or associate a release and cycle to the issue, follow these rules: 15. If the user provides a release ID, map it from projects.releases[index].releaseID in the project info response, and use that ID in affectedRelease as an array of numeric IDs. 16. If the user provides both release and cycle IDs, validate both against the current project's releases and cycles; if valid, use them in affectedCycles and affectedRelease as arrays of numeric IDs respectively. 17. If the user provides a release name, map it to its ID from project info; if a cycle name is provided, map it to its ID and use it in payload as value of field affectedRelease and affectedCycles. 18. LLM should ensure that provided release/cycle names or IDs exist in the current project before using them in the payload. If not found, skip and show a user-friendly message: 'Issue created without release/cycle association, as given release/cycle is not available in the current project.' 19. Ensure all IDs used are valid for the current QMetry project context 20. This tool is essential for defect management and test execution linkage 21. Helps maintain traceability between test executions and reported issues 22. Critical for quality assurance and defect lifecycle management 23. Use for creating issues directly from test execution contexts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baseUrl | No | The base URL for the QMetry instance (must be a valid URL) | |
| summary | Yes | Summary or title of the defect/issue | |
| tcRunID | No | Test Case Run ID to link this defect/issue to a test execution (optional) | |
| component | No | Component IDs associated with the issue | |
| issueType | Yes | Issue type ID (e.g. Bug, Enhancement, etc.) | |
| sync_with | No | External system to sync with (e.g. JIRA, QMetry, etc.) | |
| issueOwner | No | Owner/user ID for the issue | |
| projectKey | No | Project key - unique identifier for the project | default |
| description | No | Detailed description of the defect/issue | |
| issuePriority | Yes | Issue priority ID (e.g. High, Medium, Low, etc.) | |
| affectedCycles | No | Cycle IDs affected by this issue | |
| affectedRelease | No | Release IDs affected by this issue |