Checklist items
On this page:
Create a checklist item
Summary
Create a checklist.item
POST /api/v11/checkListDefinitions/{id}/items
Description
Create a new checklist item.
Parameters
| Parameter | Description | Type | Parameter Type |
Required |
|---|---|---|---|---|
id
|
Identifier for the checklist item. | string | body | Yes |
name
|
Name of the checklist item. | string | body | Yes |
description
|
Description of the checklist item. | string | body | Yes |
aiEnabled
|
true if this checklist item is run by AI or false if run manually. |
boolean | body | Yes |
aiPromptBody
|
If prompt to pass to the AI vendor. | string | body | Yes |
autoTriggerAI
|
true if this checklist item runs automatically when the review is created or updated. false if the checklist item run is triggered manually. See Manually trigger a checklist item and Create a checkListRun when a review is created. |
boolean | body | Yes |
Example usage
Create a configuration
curl -X POST -H "Content-Type: application/json" -u "username:ticket" -d "@mybodyfilename.txt" "https://myswarm-url/api/v11/checkListDefinitions/2/items"
The mybodyfilename.txt file contains the create configuration details:
{
"id": "functionality",
"name": "Functionality",
"description": "Check the functionality as per the requirements.",
"aiEnabled": true,
"aiPromptBody": "Your prompt for <insert change details here>",
"autoTriggerAI": false,
}
JSON Response:
{
"error": null,
"messages": [],
"data": {
"items": [
{
"id": "functionality",
"name": "Functionality",
"description": "Check the functionality as per the requirements.",
"aiEnabled": true,
"aiPromptBody": " "aiPromptBody": "Your prompt for <insert change details here>",
"autoTriggerAI": false,
}
]
}
}
If the request fails
<error code>:
- Items cannot have the same id, 'functionality' is already in use.
- Item names cannot contain HTML tags.
- Name is required for an item..
400 such as:
Patch a checklist item
Summary
Add a checklist item to an existing checklist definition.
PATCH /api/v11/checkListDefinitions/{id}/items/{name}
Description
Only the fields provided in the request body will be modified. All other fields on the resource remain unchanged.
Parameters
| Parameter | Description | Type | Parameter Type |
Required |
|---|---|---|---|---|
name
|
Identifier for the checklist item. | string | path | Yes |
Example usage
curl -X PATCH -H "Content-Type: application/json" -u "username:ticket" -d "@mybodyfilename.txt" "https://myswarm-url/api/v11/checkListDefinitions/2/items/coding-standards
The mybodyfilename.txt file contains the fields to update:
{
"name": "PHP Coding Standards"
}
JSON Response shows the update on line 17:
{
"error": null,
"messages": [],
"data": {
"items": [
{
"id": "functionality",
"name": "Functionality",
"description": "Check the functionality as per the requirements.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the functionality of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
},
{
"id": "php-coding-standards",
"name": "PHP Coding Standards",
"description": "Check the Coding Standards as per the psr6.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the Coding Standards as per the psr6 of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
}
]
}
}
If the request fails
<error code>:
400 The 2 checklist does not have a coding-standards2345 item.
404 Cannot fetch entry. Id does not exist.
Get checklist items
Summary
Get information about the items in the specified checklist.
GET /api/v11/checkListDefinitions/{id}
Description
Returns information about the checklist items.
Example usage
curl -u "username:password" "https://my-swarm-host/api/v11/checkListDefinitions/2/items
JSON Response:
{
"error": null,
"messages": [],
"data": {
"items": [
{
"id": "functionality",
"name": "Functionality",
"description": "Check the functionality as per the requirements.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the functionality of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
},
{
"id": "coding-standards",
"name": "Coding Standards",
"description": "Check the Coding Standards as per the psr6.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the Coding Standards as per the psr6 of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
}
]
}
}
If a request fails
<error code>:
-
404 Cannot fetch entry. Id does not exist.
-
nullif no checklist items exist
Delete a checklist item
Summary
Delete the specified checklist definition.
DELETE /api/v11/checkListDefinitions/{id}/items/{id}
Description
Deletes the checklist items that corresponds to the id.
Example usage
curl -X DELETE -H "Content-Type: application/json" -u "username:ticket" -d " "https://myswarm-url/api/v11/checkListDefinitions/2/items/business-logic
JSON Response omits the deleted "business-logic" but retains "functionality" and "php-coding-standards":
{
"error": null,
"messages": [],
"data": {
"items": [
{
"id": "functionality",
"name": "Functionality",
"description": "Check the functionality as per the requirements.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the functionality of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
},
{
"id": "php-coding-standards",
"name": "PHP Coding Standards",
"description": "Check the Coding Standards as per the psr6.",
"aiEnabled": true,
"aiPromptBody": "As an expert in software development, review the following change and provide feedback on the Coding Standards as per the psr6 of the code.Here is the change: <insert change details here>",
"autoTriggerAI": false,
}
]
}
}
If a request fails
<error code>:
-
404 Cannot fetch entry. Id does not exist.