feat: notify on task auto pause, manual pause and manual resume (#22050)

This commit is contained in:
Danielle Maywood
2026-02-18 16:30:16 +00:00
committed by GitHub
parent dcdca814d6
commit 31c1279202
12 changed files with 569 additions and 37 deletions
@@ -0,0 +1,4 @@
-- Remove Task 'paused' transition template notification
DELETE FROM notification_templates WHERE id = '2a74f3d3-ab09-4123-a4a5-ca238f4f65a1';
-- Remove Task 'resumed' transition template notification
DELETE FROM notification_templates WHERE id = '843ee9c3-a8fb-4846-afa9-977bec578649';
@@ -0,0 +1,63 @@
-- Task transition to 'paused' status
INSERT INTO notification_templates (
id,
name,
title_template,
body_template,
actions,
"group",
method,
kind,
enabled_by_default
) VALUES (
'2a74f3d3-ab09-4123-a4a5-ca238f4f65a1',
'Task Paused',
E'Task ''{{.Labels.task}}'' is paused',
E'The task ''{{.Labels.task}}'' was paused ({{.Labels.pause_reason}}).',
'[
{
"label": "View task",
"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.task_id}}"
},
{
"label": "View workspace",
"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}"
}
]'::jsonb,
'Task Events',
NULL,
'system'::notification_template_kind,
true
);
-- Task transition to 'resumed' status
INSERT INTO notification_templates (
id,
name,
title_template,
body_template,
actions,
"group",
method,
kind,
enabled_by_default
) VALUES (
'843ee9c3-a8fb-4846-afa9-977bec578649',
'Task Resumed',
E'Task ''{{.Labels.task}}'' has resumed',
E'The task ''{{.Labels.task}}'' has resumed.',
'[
{
"label": "View task",
"url": "{{base_url}}/tasks/{{.UserUsername}}/{{.Labels.task_id}}"
},
{
"label": "View workspace",
"url": "{{base_url}}/@{{.UserUsername}}/{{.Labels.workspace}}"
}
]'::jsonb,
'Task Events',
NULL,
'system'::notification_template_kind,
true
);