freshservice-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFreshservice Automation via Rube MCP
通过Rube MCP实现Freshservice自动化
Automate Freshservice IT Service Management operations through Composio's Freshservice toolkit via Rube MCP.
通过Composio的Freshservice工具包,借助Rube MCP自动化Freshservice IT服务管理操作。
Prerequisites
前置条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Freshservice connection via with toolkit
RUBE_MANAGE_CONNECTIONSfreshservice - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 必须已连接Rube MCP(RUBE_SEARCH_TOOLS可用)
- 通过并使用工具包
RUBE_MANAGE_CONNECTIONS建立有效的Freshservice连接freshservice - 请始终先调用以获取最新的工具架构
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSfreshservice - If connection is not ACTIVE, follow the returned auth link to complete Freshservice authentication
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥——只需添加端点即可使用。
https://rube.app/mcp- 确认能正常响应,以此验证Rube MCP可用
RUBE_SEARCH_TOOLS - 调用并指定工具包
RUBE_MANAGE_CONNECTIONSfreshservice - 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成Freshservice身份验证
- 在运行任何工作流之前,确认连接状态显示为ACTIVE
Core Workflows
核心工作流
1. List and Search Tickets
1. 列出并搜索工单
When to use: User wants to find, list, or search for tickets
Tool sequence:
- - List tickets with optional filtering and pagination [Required]
FRESHSERVICE_LIST_TICKETS - - Get detailed information for a specific ticket [Optional]
FRESHSERVICE_GET_TICKET
Key parameters for listing:
- : Predefined filter ('all_tickets', 'deleted', 'spam', 'watching')
filter - : ISO 8601 timestamp to get tickets updated after this time
updated_since - : Sort field ('created_at', 'updated_at', 'status', 'priority')
order_by - : Sort direction ('asc' or 'desc')
order_type - : Page number (1-indexed)
page - : Results per page (1-100, default 30)
per_page - : Additional fields ('requester', 'stats', 'description', 'conversations', 'assets')
include
Key parameters for get:
- : Unique ticket ID or display_id
ticket_id - : Additional fields to include
include
Pitfalls:
- By default, only tickets created within the past 30 days are returned
- Use to retrieve older tickets
updated_since - Each value consumes additional API credits
include - is 1-indexed; minimum value is 1
page - max is 100; default is 30
per_page - Ticket IDs can be the internal ID or the display_id shown in the UI
适用场景:用户需要查找、列出或搜索工单
工具流程:
- - 列出工单,可选择过滤和分页 [必填]
FRESHSERVICE_LIST_TICKETS - - 获取特定工单的详细信息 [可选]
FRESHSERVICE_GET_TICKET
列单关键参数:
- : 预定义过滤器('all_tickets'、'deleted'、'spam'、'watching')
filter - : ISO 8601时间戳,用于获取该时间之后更新的工单
updated_since - : 排序字段('created_at'、'updated_at'、'status'、'priority')
order_by - : 排序方向('asc'或'desc')
order_type - : 页码(从1开始)
page - : 每页结果数(1-100,默认30)
per_page - : 附加字段('requester'、'stats'、'description'、'conversations'、'assets')
include
获取工单关键参数:
- : 唯一的工单ID或display_id
ticket_id - : 要包含的附加字段
include
注意事项:
- 默认仅返回过去30天内创建的工单
- 使用参数获取更早的工单
updated_since - 每个值会消耗额外的API额度
include - 从1开始;最小值为1
page - 最大值为100;默认值为30
per_page - 工单ID可以是内部ID或UI中显示的display_id
2. Create a Ticket
2. 创建工单
When to use: User wants to log a new incident or request
Tool sequence:
- - Create a new ticket [Required]
FRESHSERVICE_CREATE_TICKET
Key parameters:
- : Ticket subject line (required)
subject - : HTML description of the ticket (required)
description - : Ticket status - 2 (Open), 3 (Pending), 4 (Resolved), 5 (Closed) (required)
status - : Ticket priority - 1 (Low), 2 (Medium), 3 (High), 4 (Urgent) (required)
priority - : Requester's email address (provide either email or requester_id)
email - : User ID of the requester
requester_id - : Ticket type ('Incident' or 'Service Request')
type - : Channel - 1 (Email), 2 (Portal), 3 (Phone), 4 (Chat), 5 (Twitter), 6 (Facebook)
source - : Impact level - 1 (Low), 2 (Medium), 3 (High)
impact - : Urgency level - 1 (Low), 2 (Medium), 3 (High), 4 (Critical)
urgency
Pitfalls:
- ,
subject,description, andstatusare all requiredpriority - Either or
emailmust be provided to identify the requesterrequester_id - Status and priority use numeric codes, not string names
- Description supports HTML formatting
- If email does not match an existing contact, a new contact is created
适用场景:用户需要记录新的事件或请求
工具流程:
- - 创建新工单 [必填]
FRESHSERVICE_CREATE_TICKET
关键参数:
- : 工单主题(必填)
subject - : 工单的HTML格式描述(必填)
description - : 工单状态 - 2(已打开)、3(待处理)、4(已解决)、5(已关闭)(必填)
status - : 工单优先级 - 1(低)、2(中)、3(高)、4(紧急)(必填)
priority - : 请求者的邮箱地址(需提供email或requester_id其中一个)
email - : 请求者的用户ID
requester_id - : 工单类型('Incident'或'Service Request')
type - : 渠道 - 1(邮件)、2(门户)、3(电话)、4(聊天)、5(Twitter)、6(Facebook)
source - : 影响级别 - 1(低)、2(中)、3(高)
impact - : 紧急程度 - 1(低)、2(中)、3(高)、4(严重)
urgency
注意事项:
- 、
subject、description和status均为必填项priority - 必须提供或
email其中一个以识别请求者requester_id - 状态和优先级使用数字编码,而非字符串名称
- 描述支持HTML格式
- 如果邮箱与现有联系人不匹配,将创建一个新联系人
3. Bulk Update Tickets
3. 批量更新工单
When to use: User wants to update multiple tickets at once
Tool sequence:
- - Find tickets to update [Prerequisite]
FRESHSERVICE_LIST_TICKETS - - Update multiple tickets [Required]
FRESHSERVICE_BULK_UPDATE_TICKETS
Key parameters:
- : Array of ticket IDs to update (required)
ids - : Dictionary of fields to update (required)
update_fields- Allowed keys: 'subject', 'description', 'status', 'priority', 'responder_id', 'group_id', 'type', 'tags', 'custom_fields'
Pitfalls:
- Bulk update performs sequential updates internally; large batches may take time
- All specified tickets receive the same field updates
- If one ticket update fails, others may still succeed; check response for individual results
- Cannot selectively update different fields per ticket in a single call
- Custom fields must use their internal field names, not display names
适用场景:用户需要一次性更新多个工单
工具流程:
- - 查找需要更新的工单 [前置步骤]
FRESHSERVICE_LIST_TICKETS - - 批量更新工单 [必填]
FRESHSERVICE_BULK_UPDATE_TICKETS
关键参数:
- : 要更新的工单ID数组(必填)
ids - : 要更新的字段字典(必填)
update_fields- 允许的键:'subject'、'description'、'status'、'priority'、'responder_id'、'group_id'、'type'、'tags'、'custom_fields'
注意事项:
- 批量更新在内部执行顺序更新;大批量操作可能需要耗时
- 所有指定工单都会收到相同的字段更新
- 如果某个工单更新失败,其他工单可能仍会成功;请检查响应中的单个结果
- 单次调用中无法针对不同工单选择性更新不同字段
- 自定义字段必须使用其内部字段名称,而非显示名称
4. Create Ticket via Outbound Email
4. 通过外发邮件创建工单
When to use: User wants to create a ticket by sending an outbound email notification
Tool sequence:
- - Create ticket with email notification [Required]
FRESHSERVICE_CREATE_TICKET_OUTBOUND_EMAIL
Key parameters:
- : Requester's email address (required)
email - : Email subject / ticket subject (required)
subject - : HTML email body content
description - : Ticket status (2=Open, 3=Pending, 4=Resolved, 5=Closed)
status - : Ticket priority (1=Low, 2=Medium, 3=High, 4=Urgent)
priority - : Array of CC email addresses
cc_emails - : Email configuration ID for the sender address
email_config_id - : Requester name
name
Pitfalls:
- This creates a standard ticket via the /api/v2/tickets endpoint while sending an email
- If the email does not match an existing contact, a new contact is created with the provided name
- determines which email address the notification appears to come from
email_config_id
适用场景:用户需要通过发送外发邮件通知来创建工单
工具流程:
- - 创建工单并发送邮件通知 [必填]
FRESHSERVICE_CREATE_TICKET_OUTBOUND_EMAIL
关键参数:
- : 请求者的邮箱地址(必填)
email - : 邮件主题/工单主题(必填)
subject - : HTML格式的邮件正文内容
description - : 工单状态(2=已打开,3=待处理,4=已解决,5=已关闭)
status - : 工单优先级(1=低,2=中,3=高,4=紧急)
priority - : 抄送邮箱地址数组
cc_emails - : 发件人地址的邮件配置ID
email_config_id - : 请求者姓名
name
注意事项:
- 此操作会通过/api/v2/tickets端点创建标准工单,同时发送邮件
- 如果邮箱与现有联系人不匹配,将使用提供的姓名创建一个新联系人
- 决定了通知邮件显示的发件人地址
email_config_id
5. Create Service Requests
5. 创建服务请求
When to use: User wants to submit a service catalog request
Tool sequence:
- - Create a service request for a catalog item [Required]
FRESHSERVICE_CREATE_SERVICE_REQUEST
Key parameters:
- : Display ID of the catalog item (required)
item_display_id - : Requester's email address
email - : Number of items to request (default: 1)
quantity - : Custom field values for the service item form
custom_fields - : Display ID of a parent ticket (for child requests)
parent_ticket_id
Pitfalls:
- can be found in Admin > Service Catalog > item URL (e.g., /service_catalog/items/1)
item_display_id - Custom fields keys must match the service item form field names
- Quantity defaults to 1 if not specified
- Service requests follow the approval workflow defined for the catalog item
适用场景:用户需要提交服务目录请求
工具流程:
- - 为目录项创建服务请求 [必填]
FRESHSERVICE_CREATE_SERVICE_REQUEST
关键参数:
- : 目录项的显示ID(必填)
item_display_id - : 请求者的邮箱地址
email - : 请求的项数量(默认:1)
quantity - : 服务项表单的自定义字段值
custom_fields - : 父工单的显示ID(用于子请求)
parent_ticket_id
注意事项:
- 可在管理员>服务目录>项URL中找到(例如:/service_catalog/items/1)
item_display_id - 自定义字段键必须与服务项表单字段名称匹配
- 如果未指定数量,默认值为1
- 服务请求会遵循为目录项定义的审批工作流
Common Patterns
通用模式
Status Code Reference
状态码参考
| Code | Status |
|---|---|
| 2 | Open |
| 3 | Pending |
| 4 | Resolved |
| 5 | Closed |
| 编码 | 状态 |
|---|---|
| 2 | 已打开 |
| 3 | 待处理 |
| 4 | 已解决 |
| 5 | 已关闭 |
Priority Code Reference
优先级编码参考
| Code | Priority |
|---|---|
| 1 | Low |
| 2 | Medium |
| 3 | High |
| 4 | Urgent |
| 编码 | 优先级 |
|---|---|
| 1 | 低 |
| 2 | 中 |
| 3 | 高 |
| 4 | 紧急 |
Pagination
分页
- Use (1-indexed) and
page(max 100) parametersper_page - Increment by 1 each request
page - Continue until returned results count <
per_page - Default page size is 30
- 使用(从1开始)和
page(最大100)参数per_page - 每次请求将加1
page - 持续请求直到返回的结果数小于
per_page - 默认每页大小为30
Finding Tickets by Date Range
按日期范围查找工单
1. Call FRESHSERVICE_LIST_TICKETS with updated_since='2024-01-01T00:00:00Z'
2. Optionally add order_by='updated_at' and order_type='desc'
3. Paginate through results1. 调用FRESHSERVICE_LIST_TICKETS并设置updated_since='2024-01-01T00:00:00Z'
2. 可选添加order_by='updated_at'和order_type='desc'
3. 分页遍历结果Known Pitfalls
已知注意事项
Numeric Codes:
- Status and priority use numeric values, not strings
- Source channel uses numeric codes (1-6)
- Impact and urgency use numeric codes (1-3 or 1-4)
Date Filtering:
- Default returns only tickets from the last 30 days
- Use parameter for older tickets
updated_since - Date format is ISO 8601 (e.g., '2024-01-01T00:00:00Z')
Rate Limits:
- Freshservice API has per-account rate limits
- Each option consumes additional API credits
include - Implement backoff on 429 responses
Response Parsing:
- Response data may be nested under or
datadata.data - Parse defensively with fallback patterns
- Ticket IDs are numeric integers
数字编码:
- 状态和优先级使用数值,而非字符串
- 来源渠道使用数字编码(1-6)
- 影响级别和紧急程度使用数字编码(1-3或1-4)
日期过滤:
- 默认仅返回过去30天的工单
- 使用参数获取更早的工单
updated_since - 日期格式为ISO 8601(例如:'2024-01-01T00:00:00Z')
速率限制:
- Freshservice API有每个账户的速率限制
- 每个选项会消耗额外的API额度
include - 在收到429响应时请实现退避机制
响应解析:
- 响应数据可能嵌套在或
data下data.data - 使用防御性解析并设置回退模式
- 工单ID为数值整数
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| List tickets | FRESHSERVICE_LIST_TICKETS | filter, updated_since, page, per_page |
| Get ticket | FRESHSERVICE_GET_TICKET | ticket_id, include |
| Create ticket | FRESHSERVICE_CREATE_TICKET | subject, description, status, priority, email |
| Bulk update | FRESHSERVICE_BULK_UPDATE_TICKETS | ids, update_fields |
| Outbound email ticket | FRESHSERVICE_CREATE_TICKET_OUTBOUND_EMAIL | email, subject, description |
| Service request | FRESHSERVICE_CREATE_SERVICE_REQUEST | item_display_id, email, quantity |
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 列出工单 | FRESHSERVICE_LIST_TICKETS | filter, updated_since, page, per_page |
| 获取工单 | FRESHSERVICE_GET_TICKET | ticket_id, include |
| 创建工单 | FRESHSERVICE_CREATE_TICKET | subject, description, status, priority, email |
| 批量更新 | FRESHSERVICE_BULK_UPDATE_TICKETS | ids, update_fields |
| 外发邮件创建工单 | FRESHSERVICE_CREATE_TICKET_OUTBOUND_EMAIL | email, subject, description |
| 服务请求 | FRESHSERVICE_CREATE_SERVICE_REQUEST | item_display_id, email, quantity |