Issue
An Issue
is an object used to store and display specific details about a failed Test
or Testcase
, providing developers a more focused look at a particular failure.
TIP
Issues are typically auto-generated by the system whenever a Test
or Testcase
completes with a status of "failed". This feature can be silenced by switching off create_issue
in the account configs.
Issue object
{
"id": "bda0f49c-b876-44fc-b9a6-a40f662de5f7", // uuid specific to Issue
"time_created": "2024-07-25T20:18:25.403052Z", // timestamp of Issue creation
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50", // uuid of associated Account
"title": "Testcase \"Login, Booking Flow\" Failed", // title of Issue
"status": "open", // status, either 'open' or 'closed'
"labels": null, // optional JSON array for labeling
"trigger": { // infomation about what caused the Issue to be created
"id": "68fc7870-9e2c-45ae-be4a-46dc90cd469b", // uuid of resource that 'failed'
"type": "testcase" // resource type, either 'test' or 'testcase'
},
"affected": {
"id": "552a8584-d727-4091-9c4f-41a1fc859e16", // infomation about what resource is affected by the Issue
"str": "https://example.com.com", // the string representation of the resource
"type": "site" // resource type, either 'site' or 'page'
},
"details": "Testcase [Login, Booking Flow](/testcase/68fc7870-9e2c-45ae-be4a-46dc90cd469b) failed on **Step 15**...", // details of the Issue describing the failure formatted with Markdown
}
Create or Update Issue
There are two usecases for this endpoint, Creating and Updating Issues
.
POST - /issue
# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')
# setup configs
url = f'{SCANERR_API_BASE_URL}/issue'
headers = {
"content-type": "application/json",
"Authorization" : SCANERR_API_TOKEN
}
data = {
"id": None, # Insert <issue:id> if updating issue
"affected": {
"id": "552a8584-d727-4091-9c4f-41a1fc859e16",
"str": "https://example.com.com",
"type": "site"
},
"trigger": {
"id": "68fc7870-9e2c-45ae-be4a-46dc90cd469b",
"type": "testcase"
},
"title": "Testcase \"Login, Booking Flow\" Failed",
"details": "Testcase [Login, Booking Flow](/testcase/68fc7870-9e2c-45ae-be4a-46dc90cd469b)..."
}
# send the request
res = requests.post(
url=url,
headers=headers,
data=json.dumps(data)
)
# retrieve response data
json_response = res.json()
print(json_response)
View Full Output
Output:
{
"id": "bda0f49c-b876-44fc-b9a6-a40f662de5f7",
"time_created": "2024-07-25T20:18:25.403052Z",
"trigger": {
"id": "68fc7870-9e2c-45ae-be4a-46dc90cd469b",
"type": "testcase"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Testcase \"Login, Booking Flow\" Failed",
"details": "Testcase [Login, Booking Flow](/testcase/68fc7870-9e2c-45ae-be4a-46dc90cd469b)..."
"status": "open",
"affected": {
"id": "552a8584-d727-4091-9c4f-41a1fc859e16",
"str": "https://example.com",
"type": "site"
},
"labels": null
}
Retrieve an Issue
This endpoint returns a single Issue
object and is useful as a simple "detailed view" of the issue.
GET - /issue/<issue:id>
import requests, os
# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')
# setup configs
url = f'{BASE_URL}/issue/<issue:id>'
headers = {
"content-type": "application/json",
"Authorization" : SCANERR_API_TOKEN
}
# send the request
res = requests.get(
url=url,
headers=headers,
)
# retrieve response data
json_response = res.json()
print(json_response)
View Full Output
Output:
{
"id": "bda0f49c-b876-44fc-b9a6-a40f662de5f7",
"time_created": "2024-07-25T20:18:25.403052Z",
"trigger": {
"id": "68fc7870-9e2c-45ae-be4a-46dc90cd469b",
"type": "testcase"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Testcase \"Login, Booking Flow\" Failed",
"details": "Testcase [Login, Booking Flow](/testcase/68fc7870-9e2c-45ae-be4a-46dc90cd469b)..."
"status": "open",
"affected": {
"id": "552a8584-d727-4091-9c4f-41a1fc859e16",
"str": "https://example.com",
"type": "site"
},
"labels": null
}
Retrieve many Issues
This endpoint returns a paginated response with all Issue
objects filtered by your account and ordered by time_created
. This endpoint is useful when needing to displaying your issues in a table view for example. The limit
parameter specifies the total number of objects you want returned per "group" (we recommend keeping this under 10 for best performance). The offset
parameter specfies which "group" to return. For example, limit=10&offset=10
in a total dataset of 30 objects would return 10 issues in range issue #10 - issue #20.
GET - /issue?limit=10&offset=0
import requests, os
# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')
# setup configs
url = f'{BASE_URL}/issue?limit=10&offset=0'
headers = {
"content-type": "application/json",
"Authorization" : SCANERR_API_TOKEN
}
# send the request
res = requests.get(
url=url,
headers=headers,
)
# retrieve response data
json_response = res.json()
print(json_response)
View Full Output
Output:
{
"count":30,
"next":"https://api.scanerr.io/v1/ops/issue?limit=10&offset=20",
"previous":"https://api.scanerr.io/v1/ops/issue?limit=10&offset=10",
"results":[
{
"id": "bda0f49c-b876-44fc-b9a6-a40f662de5f7",
"time_created": "2024-07-25T20:18:25.403052Z",
"trigger": {
"id": "68fc7870-9e2c-45ae-be4a-46dc90cd469b",
"type": "testcase"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Testcase \"Login, Booking Flow\" Failed",
"details": "Testcase [Login, Booking Flow](/testcase/68fc7870-9e2c-45ae-be4a-46dc90cd469b) failed on **Step 15**...",
"status": "open",
"affected": {
"id": "552a8584-d727-4091-9c4f-41a1fc859e16",
"str": "https://example.com",
"type": "site"
},
"labels": null
},
{
"id": "f2293ab2-1763-4e4b-af9a-0387423b2557",
"time_created": "2024-07-19T17:25:42.048725Z",
"trigger": {
"id": "18787578-cf51-4c0d-9b09-06e0654a9455",
"type": "testcase"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Testcase \"Copy - Apply\" Failed",
"details": "#### Testcase [Copy - Apply](/testcase/18787578-cf51-4c0d-9b09-06e0654a9455) failed on **Step 3**, `change`...",
"status": "open",
"affected": {
"id": "78f7e9ef-59ea-41ec-af07-5e8ddb941e0c",
"str": "https://example.com",
"type": "site"
},
"labels": null
},
{
"id": "01133bb1-7a87-4782-97a6-789e9a7bb0cb",
"time_created": "2024-07-17T22:46:13.112592Z",
"trigger": {
"id": "a152e50c-350f-4919-8bc2-99024fcfe507",
"type": "test"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Test Failed at 67.71%",
"details": "[Test](/test/a152e50c-350f-4919-8bc2-99024fcfe507) \nfailed for the page [https://example.com](/page/de7f36aa-dc1e-4350-aed9-0c542a98eca3) \nbased on the set threshold of 95.0%.\n\n### Failing Components:\n| Component | Score |\n|:-----|-----:|\n| vrt | 0 |",
"status": "open",
"affected": {
"id": "de7f36aa-dc1e-4350-aed9-0c542a98eca3",
"str": "https://example.com",
"type": "page"
},
"labels": null
},
{
"id": "7de93132-7442-4518-9efd-fe042876f2b3",
"time_created": "2024-07-17T23:08:18.875767Z",
"trigger": {
"id": "19173316-7c57-4b0e-94fe-0b15ac4657bb",
"type": "testcase"
},
"account": "2177f04e-a29c-4042-ab2f-69ad509a7d50",
"title": "Testcase \"Copy - Apply\" Failed",
"details": "Testcase [Copy - Apply](/testcase/19173316-7c57-4b0e-94fe-0b15ac4657bb) failed on **Step 2**...",
"status": "closed",
"affected": {
"id": "6cd358e5-94e0-4490-9b86-792e21bacfab",
"str": "https://example.com",
"type": "site"
},
"labels": null
}
### SHORTENED FOR DISPLAY PURPOSES ###
]
}
Delete an Issue
DANGER
Please use caution with this endpoint as it is irreversible.
DELETE - /issue/<issue:id>
import requests, os
# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')
# setup configs
url = f'{BASE_URL}/issue/<issue:id>'
headers = {
"content-type": "application/json",
"Authorization" : SCANERR_API_TOKEN
}
# send the request
res = requests.delete(
url=url,
headers=headers,
)
# retrieve response data
json_response = res.json()
print(json_response)
View Full Output
Output:
{
"message": "issue deleted successfully"
}