feat: automation rules
Owners and admins can set rules of the kind «when a ticket is created, moves, gets assigned, gets a comment or its pull request merges; if it is of this type, priority, area or label; then move it, assign it, label it, change its priority, comment or put it in the active sprint». Rules act as TaskStream within the workflow, run once per event and trigger no others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,46 @@ export interface Webhook {
|
||||
lastDelivery: WebhookDelivery | null;
|
||||
}
|
||||
|
||||
export type AutomationTriggerKind =
|
||||
| 'ISSUE_CREATED'
|
||||
| 'STATUS_CHANGED'
|
||||
| 'ISSUE_ASSIGNED'
|
||||
| 'COMMENT_ADDED'
|
||||
| 'PULL_REQUEST_MERGED';
|
||||
|
||||
export type AutomationActionKind =
|
||||
| 'SET_STATUS'
|
||||
| 'ASSIGN'
|
||||
| 'ASSIGN_REPORTER'
|
||||
| 'ADD_LABEL'
|
||||
| 'SET_PRIORITY'
|
||||
| 'ADD_COMMENT'
|
||||
| 'ADD_TO_ACTIVE_SPRINT';
|
||||
|
||||
/** «When this happens to a ticket, if it is like this, do that.» */
|
||||
export interface Automation {
|
||||
id: string;
|
||||
name: string;
|
||||
active: boolean;
|
||||
trigger: { kind: AutomationTriggerKind; status?: string | null };
|
||||
conditions: {
|
||||
types?: string[] | null;
|
||||
priorities?: IssuePriority[] | null;
|
||||
areas?: string[] | null;
|
||||
label?: string | null;
|
||||
};
|
||||
action: { kind: AutomationActionKind; value?: string | null };
|
||||
createdBy: UserRef;
|
||||
runs: number;
|
||||
lastRunAt: string | null;
|
||||
lastError: string | null;
|
||||
}
|
||||
|
||||
export type AutomationInput = Pick<
|
||||
Automation,
|
||||
'name' | 'trigger' | 'conditions' | 'action'
|
||||
>;
|
||||
|
||||
/** What an import did (or, as a preview, would do). */
|
||||
export interface ImportReport {
|
||||
format: 'taskstream' | 'jira';
|
||||
|
||||
Reference in New Issue
Block a user