Library › Coding AI › Customer support teams
Write ticket routing rules as clear if/else steps
Practice: Asking for a format you can use. About 5 minutes.
About this exercise
Write the routing rules for new tickets as pseudo-code in one code block, using only IF, ELSE IF and ELSE lines with one action each, at most 8 lines. Enterprise customers always go to the Enterprise queue first, even for refunds. Refund-tagged tickets over $200 (more than, so exactly $200 doesn't count) go to Tier 2 with an internal note; other refund tickets get the Refund under 200 macro; everything else goes to General. Rules must never auto-reply to or close a ticket. Under 25 words outside the code.
Common mistakes when you ask AI for this
- Leaving the order open. The AI checks refunds first, so Enterprise refunds miss their queue. Try: Add: "Enterprise first, even for refunds."
- Leaving the edge vague. The AI uses 200 or more, so exactly $200 goes to Tier 2 again. Try: Add: "More than $200, not $200 itself."
- Not ruling out risky actions. The AI adds a friendly auto-reply or closes duplicates. Try: Add: "Never auto-reply or close."
- Not giving the shape. The AI writes paragraphs or a flowchart description. Try: Add: "Only IF / ELSE IF / ELSE lines, one action each, at most 8 lines."
- Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 10 words. Nothing else."
What a strong prompt includes
- Puts Enterprise first
- Sets the $200 edge
- Rules out risky actions
- Gives the shape
- Caps the code length
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)