CRM-142: the full ticket
Download original ↓CRM-142: Import contacts from CSV
Sample Jira ticket · AgentBay walkthrough · fictional CRM and contacts
Why
Our customer-success team gets contact lists from customers in spreadsheets. Today they add every contact by hand. Let them upload a CSV, see what will be added and fix problems before importing.
Feature
Add Import contacts to the existing Contacts page. The file has name, email and company columns. Preview every nonblank data record with an outcome: Ready, Invalid or Duplicate. Show counts before anything is saved. Let the user import ready rows, or cancel and keep their existing contacts unchanged. Return to the list and say how many contacts were added and skipped.
Acceptance criteria
- Existing contact search and Add contact still work. Imported contacts appear in that same list and survive reload in this browser.
- Required columns: name and email. Company is optional. Trim surrounding whitespace; tolerate UTF-8 BOM and CRLF. Reject duplicate header names, missing required headers, extra columns in a row or unclosed quotes without saving anything.
- Handle quoted commas, escaped double quotes and newlines within a quoted field. Blank records are ignored. No third-party CSV dependency.
- Name must not be empty and email must have a plausible local@domain.tld shape. This is format validation, not email-delivery verification.
- Detect duplicate emails, ignoring case and surrounding whitespace, against both current contacts and earlier valid rows in the file. The first valid occurrence wins. An invalid row must not reserve an email. Never overwrite an existing contact.
- Preview does not write storage. Confirm imports only Ready rows, once. Double-clicking must not add duplicates. Revalidate against current contacts on confirmation. Zero Ready rows disables confirmation.
- A failed local save keeps the preview and lets the user retry. Cancel, malformed files and retry must not delete contacts. Do not report success until storage succeeds.
- Use labelled controls, keyboard-operable review/cancel/confirm, visible focus, a live status message and readable layout at 320px and desktop. Render CSV cells as text, including HTML-looking input.
Scope for this local exercise
Client-side CRM in plain HTML/JS. Existing storage adapter uses one namespaced localStorage key. No login, server database, field-mapping wizard, remote uploads, live CRM account or background jobs. Limit input to 100 KB and 500 data records; report those limits before upload. Provide a labelled Fail next save demo control to exercise recovery. These are fixed author decisions for a reproducible exercise, not stakeholder interviews.
Original file & source details
ticket.md · SHA-256 629d78776ddefe8a9c2f325d57f3a1310cded181692a3244ed5cc3543c4d67b0
# CRM-142 — Import contacts from CSV
Sample Jira ticket · AgentBay walkthrough · fictional CRM and contacts
## Why
Our customer-success team gets contact lists from customers in spreadsheets. Today they add every contact by hand. Let them upload a CSV, see what will be added and fix problems before importing.
## Feature
Add **Import contacts** to the existing Contacts page. The file has name, email and company columns. Preview every nonblank data record with an outcome: Ready, Invalid or Duplicate. Show counts before anything is saved. Let the user import ready rows, or cancel and keep their existing contacts unchanged. Return to the list and say how many contacts were added and skipped.
## Acceptance criteria
1. Existing contact search and Add contact still work. Imported contacts appear in that same list and survive reload in this browser.
2. Required columns: name and email. Company is optional. Trim surrounding whitespace; tolerate UTF-8 BOM and CRLF. Reject duplicate header names, missing required headers, extra columns in a row or unclosed quotes without saving anything.
3. Handle quoted commas, escaped double quotes and newlines within a quoted field. Blank records are ignored. No third-party CSV dependency.
4. Name must not be empty and email must have a plausible local@domain.tld shape. This is format validation, not email-delivery verification.
5. Detect duplicate emails, ignoring case and surrounding whitespace, against both current contacts and earlier valid rows in the file. The first valid occurrence wins. An invalid row must not reserve an email. Never overwrite an existing contact.
6. Preview does not write storage. Confirm imports only Ready rows, once. Double-clicking must not add duplicates. Revalidate against current contacts on confirmation. Zero Ready rows disables confirmation.
7. A failed local save keeps the preview and lets the user retry. Cancel, malformed files and retry must not delete contacts. Do not report success until storage succeeds.
8. Use labelled controls, keyboard-operable review/cancel/confirm, visible focus, a live status message and readable layout at 320px and desktop. Render CSV cells as text, including HTML-looking input.
## Scope for this local exercise
Client-side CRM in plain HTML/JS. Existing storage adapter uses one namespaced localStorage key. No login, server database, field-mapping wizard, remote uploads, live CRM account or background jobs. Limit input to 100 KB and 500 data records; report those limits before upload. Provide a labelled **Fail next save** demo control to exercise recovery. These are fixed author decisions for a reproducible exercise, not stakeholder interviews.