GET /tickets/automation-rules/{id}
Get automation rule
Retrieve a specific automation rule by ID
Required Parameters
id
path string Rule ID
Try it out
Loading...
Output:
Responses
Description
Automation rule retrieved successfully
{ "id": "string", "name": "string", "description": "string", "enabled": false, "trigger": "string", "conditions": [ { "field": "priority", "operator": "string", "value": null } ], "conditionsMatch": "string", "actions": [ { "type": "string", "status": "string", "priority": "string", "userId": "string", "teamId": "string" } ], "executionOrder": 0, "createdBy": "string", "createdAt": "string", "updatedAt": "string", "updatedBy": "string", "statistics": { "totalExecutions": 0, "successfulExecutions": 0, "failedExecutions": 0, "lastExecutedAt": "string", "averageExecutionTime": 0 }}Description
Insufficient permissions
Description
Rule not found
References
#/components/schemas/RuleCondition#/components/schemas/RuleAction#/components/schemas/AutomationRule#/components/schemas/AutomationRuleDetailed
#/components/schemas/RuleCondition
type: objectrequired: - field - operator - valueproperties: field: type: string description: Ticket field to evaluate example: priority operator: type: string enum: - equals - not_equals - contains - not_contains - greater_than - less_than - greater_than_or_equal - less_than_or_equal - in - not_in description: Comparison operator value: description: Value to compare against (can be string, number, boolean, or array)|export interface RuleCondition { /** Ticket field to evaluate */ field: string; /** Comparison operator */ operator: | "equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "less_than" | "greater_than_or_equal" | "less_than_or_equal" | "in" | "not_in"; /** Value to compare against (can be string, number, boolean, or array) */ value: any;}#/components/schemas/RuleAction
type: objectrequired: - typeproperties: type: type: string enum: - change_status - change_priority - assign_to_user - assign_to_team description: Action type status: type: string description: New status (for change_status action) priority: type: string description: New priority (for change_priority action) userId: type: string description: User ID to assign to (for assign_to_user action) teamId: type: string description: Team ID to assign to (for assign_to_team action)|export interface RuleAction { /** Action type */ type: | "change_status" | "change_priority" | "assign_to_user" | "assign_to_team"; /** New status (for change_status action) */ status?: string; /** New priority (for change_priority action) */ priority?: string; /** User ID to assign to (for assign_to_user action) */ userId?: string; /** Team ID to assign to (for assign_to_team action) */ teamId?: string;}#/components/schemas/AutomationRule
type: objectproperties: id: type: string description: Rule ID name: type: string description: Rule name description: type: string nullable: true description: Rule description enabled: type: boolean description: Whether rule is enabled trigger: type: string enum: - ticket_created - ticket_updated - status_changed - priority_changed - assigned - comment_added description: Event that triggers the rule conditions: type: array items: $ref: "#/components/schemas/RuleCondition" description: Conditions that must be met conditionsMatch: type: string enum: - all - any description: Whether all or any conditions must match actions: type: array items: $ref: "#/components/schemas/RuleAction" description: Actions to perform executionOrder: type: integer description: Rule execution order createdBy: type: string description: ID of rule creator createdAt: type: string format: date-time updatedAt: type: string format: date-time updatedBy: type: string nullable: true description: ID of last updater|export interface AutomationRule { /** Rule ID */ id?: string; /** Rule name */ name?: string; /** Rule description */ description?: string; /** Whether rule is enabled */ enabled?: boolean; /** Event that triggers the rule */ trigger?: | "ticket_created" | "ticket_updated" | "status_changed" | "priority_changed" | "assigned" | "comment_added"; /** Conditions that must be met */ conditions?: RuleCondition[]; /** Whether all or any conditions must match */ conditionsMatch?: "all" | "any"; /** Actions to perform */ actions?: RuleAction[]; /** Rule execution order */ executionOrder?: number; /** ID of rule creator */ createdBy?: string; createdAt?: Date; updatedAt?: Date; /** ID of last updater */ updatedBy?: string;}#/components/schemas/AutomationRuleDetailed
allOf: - type: object properties: id: type: string description: Rule ID name: type: string description: Rule name description: type: string nullable: true description: Rule description enabled: type: boolean description: Whether rule is enabled trigger: type: string enum: - ticket_created - ticket_updated - status_changed - priority_changed - assigned - comment_added description: Event that triggers the rule conditions: type: array items: $ref: "#/components/schemas/RuleCondition" description: Conditions that must be met conditionsMatch: type: string enum: - all - any description: Whether all or any conditions must match actions: type: array items: $ref: "#/components/schemas/RuleAction" description: Actions to perform executionOrder: type: integer description: Rule execution order createdBy: type: string description: ID of rule creator createdAt: type: string format: date-time updatedAt: type: string format: date-time updatedBy: type: string nullable: true description: ID of last updater fromRef: "#/components/schemas/AutomationRule" - type: object properties: statistics: type: object properties: totalExecutions: type: integer description: Total number of times rule has executed successfulExecutions: type: integer description: Number of successful executions failedExecutions: type: integer description: Number of failed executions lastExecutedAt: type: string format: date-time nullable: true description: Last execution timestamp averageExecutionTime: type: number description: Average execution time in milliseconds|export interface AutomationRuleDetailed_AllOf_0 { /** Rule ID */ id?: string; /** Rule name */ name?: string; /** Rule description */ description?: string; /** Whether rule is enabled */ enabled?: boolean; /** Event that triggers the rule */ trigger?: | "ticket_created" | "ticket_updated" | "status_changed" | "priority_changed" | "assigned" | "comment_added"; /** Conditions that must be met */ conditions?: RuleCondition[]; /** Whether all or any conditions must match */ conditionsMatch?: "all" | "any"; /** Actions to perform */ actions?: RuleAction[]; /** Rule execution order */ executionOrder?: number; /** ID of rule creator */ createdBy?: string; createdAt?: Date; updatedAt?: Date; /** ID of last updater */ updatedBy?: string;}
export interface AutomationRuleDetailed_AllOf_1 { statistics?: { totalExecutions?: number; successfulExecutions?: number; failedExecutions?: number; lastExecutedAt?: Date; averageExecutionTime?: number; };}
export type AutomationRuleDetailed = AutomationRuleDetailed_AllOf_0 & AutomationRuleDetailed_AllOf_1;Route Source Code
Check out the source code for this route entrypoint here: /tickets/automation-rules/[id]/route.ts
Or the swagger.yaml spec this documentation was generated from:
/tickets/automation-rules/swagger.yaml