POST
Ticket.AutomationSave
Create or update a ticket_automation row (dashboard Settings → Ticket automation). Omit id to create; send id to update. Requires manager permission. This is NOT AutomationEvents.* — it uses the ticket_automation table only.
Permissions
- User must be logged in with a valid bearer token.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Runs the Ticket.AutomationSave function and returns JSON.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- Requires manager permission (owner or member admin).
- condition_type: not_assigned (default) or in_status. When in_status, send condition_statuses.
- Actions are independent flags: action_send_email, action_create_mission, action_row_color.
- Send email (dashboard parity): email_to_customer → selected Email template to the ticket customer email; email_to_team → staff notify all Ticket team members + current assignees; email_user_ids (Member) → staff notify only checked users. Team/member use staff notify path — not the customer template.
- email_template_id = email_template.id for customer mail only. 0 or omit on create = default (support template / prior behavior). Alias: customer_email_template_id. Do not pass bare template_id (that is mission_template_id). Picker list: Ticket.Automation / Get email_templates[] or EmailTemplates.List.
- On update, omit email_template_id to leave the saved template unchanged.
- Mission fields (mission_*) are used when action_create_mission=1; or send mission_config JSON.
- Aliases Ticket.AutomationAdd / Edit / Update call the same handler.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
idpost | int | 3 | Rule id for update. Omit to create. Aliases: data_id, rule_id, automation_id. |
titlepost | string | Follow up unassigned | Rule / event title (dashboard Name). |
after_minutespost | int | 15 | Wait minutes after ticket open before matching (min 1, default 15). |
condition_typepost | string | not_assigned | Main event condition: not_assigned or in_status. |
condition_statusespost | array|string | 1,3 | Status ids when condition_type=in_status. Alias: condition_statuses[]. |
action_send_emailpost | int | 1 | Enable send-email sub-action (0/1). |
email_to_teampost | int | 1 | Email ticket team / staff notify (0/1). Not the customer template. |
email_to_customerpost | int | 0 | Email customer (0/1). Uses email_template_id when set. |
email_user_idspost | array|string | 47,48 | Specific member ids to email (staff notify). Alias: email_user_ids[]. |
email_template_idpost | int | 0 | email_template.id for customer mail when email_to_customer=1. 0 = default (support template / prior behavior). Must belong to this org; invalid ids become 0. Alias: customer_email_template_id. Do not use bare template_id (reserved for mission). |
customer_email_template_idpost | int | 0 | Alias of email_template_id. |
action_create_missionpost | int | 0 | Enable create-mission sub-action (0/1). |
mission_configpost | json | | Optional full mission_config JSON. Or send mission_* fields below. |
mission_textpost | string | Follow up ticket | Mission text. |
mission_assignpost | string | ticket_team | ticket_team | customer_manager | specific. |
mission_member_idspost | array|string | 47 | Member ids when mission_assign=specific. |
mission_create_only_if_no_openpost | int | 1 | Create mission only if customer has no open mission (0/1). |
mission_template_idpost | int | 0 | Template mission id. Alias: template_id. |
missions_steps_idpost | int | 0 | Mission step id. Alias: mission_steps_id. |
mission_project_idpost | int | 0 | Project id. Alias: project_id. |
mission_project_columnpost | string | | Project column key. Alias: project_column. |
mission_priority_colorpost | string | transparent | Mission priority color. |
mission_delay_typepost | string | days | minutes | hours | days. |
mission_delaypost | int | 0 | Delay amount. Alias: delay. |
action_row_colorpost | int | 0 | Enable list row-color action (0/1). |
row_colorpost | string | #ffe8cc | Row color hex when action_row_color=1. |
is_activepost | int | 1 | Active flag (0/1). Default 1 on create. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Ticket.AutomationSave",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"title": "Follow up unassigned",
"after_minutes": "15",
"condition_type": "not_assigned",
"action_send_email": "1",
"email_to_team": "1",
"email_to_customer": "1",
"email_template_id": "42",
"is_active": "1"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.AutomationSave",
"url_domain": "https:\/\/{domain}\/app\/Ticket.AutomationSave"
}Endpoint
POST /app/Ticket.AutomationSave
POST https://{user}.bull36.com/app/Ticket.AutomationSave
POST https://{domain}/app/Ticket.AutomationSaveSample Output
{
"success": 1,
"message": "Success",
"id": 3,
"data": {
"id": 3,
"title": "Follow up unassigned",
"after_minutes": 15,
"condition_type": "not_assigned",
"action_send_email": 1,
"email_to_customer": 1,
"email_template_id": 42,
"is_active": 1
}
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
title: 'Follow up unassigned',
after_minutes: '15',
condition_type: 'not_assigned',
action_send_email: '1',
email_to_team: '1',
email_to_customer: '1',
email_template_id: '42'
});
const res = await fetch('/app/Ticket.AutomationSave', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());Error Example
{
"success": 0,
"message": "Permission denied to manage ticket automation"
}