Assurance Tasks
Manage assurance and compliance tasks with the de.iterate SDK.
Overview
The assurance resource provides operations for managing recurring compliance tasks, evidence collection, and task completion workflows.
List Assurance Tasks
typescript
// List all tasks
const response = await client.assurance.list();
console.log(`Found ${response.data.length} tasks`);
// Filter by standard
const isoTasks = await client.assurance.list({
filter: { standard: 'ISO 27001' }
});
// Filter overdue tasks
const overdueTasks = await client.assurance.list({
filter: { overdue: true }
});
// Filter by assignee
const myTasks = await client.assurance.list({
filter: { assignee: 'user@company.com' }
});Response Example
json
{
"data": [
{
"id": "ASS-001",
"description": "Review access control logs",
"status": "pending",
"assignedTo": "security@company.com",
"dueDate": "2025-01-31T00:00:00Z",
"frequency": "monthly",
"evidenceRequired": true,
"controlId": "A.9.4.2",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-12-20T14:22:00Z"
}
],
"meta": {
"totalCount": 48,
"pageCount": 1,
"currentPage": 1,
"perPage": 48
}
}Get Overdue Tasks
typescript
const overdue = await client.assurance.getOverdue();
console.log(`${overdue.length} overdue tasks`);
for (const task of overdue) {
console.log(` • ${task.description} (due: ${task.dueDate})`);
}Get Tasks by Control
typescript
const controlTasks = await client.assurance.getByControl('A.9.4.2');
console.log(`Tasks for control A.9.4.2:`);
for (const task of controlTasks) {
console.log(` • ${task.description} - ${task.status}`);
}Create Assurance Task
typescript
const task = await client.assurance.create({
description: 'Quarterly penetration test review',
controlId: 'A.12.6.1',
assignedTo: 'security-team@company.com',
dueDate: new Date('2025-03-31'),
frequency: 'quarterly',
evidenceRequired: true,
});
console.log(`Created task: ${task.id}`);CreateAssuranceTaskInput
| Field | Type | Required | Description |
|---|---|---|---|
description | string | ✅ | Task description |
controlId | string | ❌ | Related control ID |
assignedTo | string | ❌ | Assignee email/ID |
dueDate | Date | ❌ | Due date |
frequency | string | ❌ | once, weekly, monthly, quarterly, annually |
evidenceRequired | boolean | ❌ | Whether evidence is required |
Update Assurance Task
typescript
const updated = await client.assurance.update('ASS-001', {
status: 'in_progress',
assignedTo: 'new-assignee@company.com',
});Complete Task with Evidence
typescript
await client.assurance.complete('ASS-001',
['access-log-jan-2025.pdf', 'review-notes.docx'],
'Monthly access log review completed. No anomalies found.'
);Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Task ID |
evidence | string[] | Array of evidence file references |
notes | string | Completion notes |
Delete Task
typescript
await client.assurance.delete('ASS-001');AssuranceTask Type
typescript
interface AssuranceTask {
id: string;
type: 'assurance_task';
description: string;
controlId?: string;
assignedTo?: string;
status: 'pending' | 'in_progress' | 'completed' | 'overdue';
dueDate?: Date | null;
completedDate?: Date | null;
frequency?: 'once' | 'weekly' | 'monthly' | 'quarterly' | 'annually' | string;
evidence?: string[];
evidenceRequired?: boolean;
createdAt: Date;
updatedAt: Date;
componentId?: string;
assID?: string;
checkDetail?: Record<string, unknown>;
checkFrequency?: Record<string, unknown>;
checkHistory?: Record<string, unknown>;
priority?: string;
}Examples
Task Dashboard
typescript
async function taskDashboard() {
const response = await client.assurance.list();
const tasks = response.data;
const byStatus = {
pending: 0,
in_progress: 0,
completed: 0,
overdue: 0,
};
for (const task of tasks) {
const status = task.status || 'pending';
if (status in byStatus) {
byStatus[status as keyof typeof byStatus]++;
}
}
console.log('Assurance Task Dashboard');
console.log('========================');
console.log(`⏳ Pending: ${byStatus.pending}`);
console.log(`🔄 In Progress: ${byStatus.in_progress}`);
console.log(`✅ Completed: ${byStatus.completed}`);
console.log(`🔴 Overdue: ${byStatus.overdue}`);
}Send Overdue Reminders
typescript
async function sendOverdueReminders() {
const overdue = await client.assurance.getOverdue();
for (const task of overdue) {
if (task.assignedTo) {
// Send reminder (integrate with your notification system)
console.log(`Reminder: Task "${task.description}" is overdue`);
console.log(` Assigned to: ${task.assignedTo}`);
console.log(` Due: ${task.dueDate}`);
}
}
}Bulk Complete Tasks
typescript
async function completeMonthlyTasks(month: string) {
const response = await client.assurance.list({
filter: { frequency: 'monthly', status: 'pending' }
});
for (const task of response.data) {
await client.assurance.complete(
task.id,
[`${month}-evidence.pdf`],
`${month} review completed`
);
}
console.log(`Completed ${response.data.length} monthly tasks`);
}Next Steps
- Checklists - Checklist-based tasks
- Compliance - Compliance calendar
- Controls - Linked controls