When a reader files the ticket after seeing an answer, hand-off puts that conversation on the ticket. Your agent sees what the reader already tried.
Set up
Add a hidden field to your ticket form. It must be on the page so the deflector can write to it. Then, on the deflector’s Hand-off tab, turn on Carry the conversation onto the ticket, set Target field to the hidden field, and click Save changes.
| Setting | Attribute | Option | Default |
|---|
| Carry the conversation onto the ticket | data-handoff-enabled | handoffEnabled | Off |
| Target field | data-handoff-target-query-selector | handoffTargetSelector | Required when hand-off is on |
| What to write | data-handoff-format | handoffFormat | link |
Turn hand-off on in the dashboard, not only on the script tag. Kelu only sends the conversation link when the deflector itself has hand-off on.
Don’t use the description field as the target. The reader would see the text, and a rich-text editor may overwrite it.
When it runs
When the reader presses Continue to submit ticket, or presses your form’s submit button again with the same question within the repeat window. The text is added after anything already in the field. The target can be an <input>, a <textarea> or an editable element.
What to write
Link to the conversation (link) writes a link to the conversation in your Kelu dashboard. Only members of your workspace can open it.
The full transcript (markdown) writes every question, answer and source. Pick it when your agents can’t open the Kelu dashboard.
### AI assistant conversation
Thread: https://app.kelu.dev/conversations/8f2c…
**Question:**
How do I rotate a client key without downtime?
**Answer:**
Create the new key first, deploy it, then revoke the old one.
**Sources:**
- Rotating client keys — https://docs.example.com/keys/rotation
Follow-up questions are included when the reader presses Continue to submit ticket. A second press of your form’s own button carries only the first answer.
If your form builds its request in code, listen for the kelu-deflector:submit event on document:
document.addEventListener("kelu-deflector:submit", (event) => {
const { link, markdown } = event.detail;
myTicket.ai_conversation = markdown ?? link ?? "";
});
event.detail holds:
| Field | What it is |
|---|
version | Always 1 |
conversationId | The id of the reader’s conversation with Kelu, the same conversation_id the form-deflect API returns. null when nothing was deflected, or when the workspace uses Zero data retention |
deflectionId | The id of this answer on the form. Use it to report the outcome. Can be null |
link | The link to the conversation, or null |
markdown | The conversation as markdown, or null |
Both link and markdown are sent whatever What to write says. The event also fires when Kelu found no answer good enough to show. Then deflectionId is set when Kelu recorded the attempt, and every other field is null.
Troubleshooting
- Nothing is written. Add
data-debug-mode="true" to the script tag and file a test ticket. The console shows hand-off target could not be written if the selector doesn’t match a field it can write to.
- The link is missing. Hand-off is on only in the script tag. Turn it on in the dashboard.