File flagged Telegram messages as Plane work items
A Telegram + Plane agent flow
A small team runs its day in a Telegram group, and bug reports surface as messages: a screenshot, a complaint, a half-sentence that starts with 'broken'. They scroll past and they're gone. This recipe rescues the ones that matter. The agent searches the group for messages carrying an agreed marker, a /bug command or a keyword, with search_messages, and opens a Plane work item per match with create_work_item, copying the message text and a link back to it. Telegram returns messages when the agent queries them, it never pushes, so the agent polls the chat on a short interval and a message id it has already filed is not filed again.
The flow
search_messagesSearches messages within a chat.
create_work_itemCreates a new work item.
Step by step
- Search for flagged messages
On each poll the agent calls search_messages in the team chat for the marker you've chosen, and reads back the matching messages with their ids, senders, and timestamps.
- Skip what's already filed
The agent records the highest message id it has processed, or checks Plane for a work item already stamped with the message id, so a re-poll of overlapping history doesn't re-file the same report.
- Open the work item
For each new match, create_work_item adds an issue to the chosen Plane project, the message text as the description, the sender and timestamp noted, and a get_message_link result included so anyone can jump back to the thread.
Tell your agent
Every two minutes, search our Telegram group for messages containing '/bug', and for any I haven't filed yet, create a Plane work item in the Triage project with the message text, the sender, and a link to the original message. Track the last message id processed.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- search_messages returns the matching messages, but a deep link back to a specific message comes from get_message_link as a separate call. The agent runs that per match if you want a clickable reference in the work item.
- Telegram's message search can return overlapping results across polls. Dedupe on the message id, not on the text, since two people can report the same bug in near-identical words.
- create_work_item drops into one Plane project and state. If reports should route to different teams, branch on a tag or keyword in the message and pick the project per item, rather than dumping everything into one backlog.
Questions
- Does the reporter find out a ticket was opened?
- Not automatically. MCP is request and response, so the agent doesn't push back into the chat on its own. You can add a second step where it calls send_message or reply_to_message with the new work item id, closing the loop for the reporter.
- Can it pull in the screenshot attached to the message?
- search_messages surfaces the message; an attached image is fetched separately via download_media. To attach it in Plane the agent downloads the media first, then includes it on the work item, which is an extra call per report.