Files
chatwoot/public/downloads/import-contacts-sample.csv
16b8693e1b fix: standardize contact company field on company_name (#14099)
Standardizes the contact company import/filter/automation contract on
`company_name`.

Closes #14096
Revives #9907

## Why

Contact company is read across the current CRM/contact UI from
`additional_attributes['company_name']`, but CSV import and a few
backend filter/automation paths still used the older `company` key. That
meant imported company values could be saved in a place the dashboard,
sorting, filters, and automation conditions did not consistently read
from.

Based on the production data check, the legacy `company` automation
configuration is effectively dead: the affected account did not have
contacts populated with `additional_attributes['company']`. So this PR
intentionally avoids adding long-term fallback behavior and uses
`company_name` as the single key going forward.

## What changed

- Contact CSV import now writes only `company_name` into
`additional_attributes['company_name']`.
- The example contact import CSV now uses the `company_name` header.
- Contact company sorting/filter config now uses `company_name`.
- Automation condition config now uses `company_name`.
- Existing standard automation conditions with `attribute_key:
'company'` are migrated to `company_name`.
- Existing saved contact filters with standard `attribute_key:
'company'` are migrated to `company_name`.
- Custom attributes named `company` are preserved and are not rewritten
by the migration.

## How to test

- Import a contact CSV with a `company_name` column and confirm the
Contact Company field is populated.
- Sort contacts by Company and confirm imported contacts are ordered
correctly.
- Create/edit an automation with Company as a condition and confirm it
saves with `company_name`.
- Verify existing saved contact filters and automation rules using the
old standard `company` key are migrated to `company_name`.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-04-27 18:43:26 +05:30

3.6 KiB

1idnameemailidentifierphone_numberip_addresscompany_namecustom_attribute_1custom_attribute_2
21Clarice Uzzellcuzzell0@mozilla.orgbb4e11cd-0f23-49da-a123-dcc1fec6852c+49896364801870.61.11.201Acme IncRandom-value-1Random-value-1
32Marieann Creeganmcreegan1@cornell.edue60bab4c-9fbb-47eb-8f75-42025b789c47+15417543010168.186.4.241Acme IncRandom-value0Random-value0
43Nancey Windibanknwindibank2@bluehost.comf793e813-4210-4bf3-a812-711418de25d2+1541754301173.44.41.59Acme IncRandom-value1Random-value1
54Sibel Stenninesstennine3@yellowbook.comd6e35a2d-d093-4437-a577-7df76316b937+15417543011115.249.27.155Acme IncRandom-value2Random-value2
65Tina O'Lunneytolunney4@si.edu3540d40a-5567-4f28-af98-5583a7ddbc56+15417543011219.181.212.8Acme IncRandom-value3Random-value3
76Quinn Neveqneve5@army.milba0e1bf0-c74b-41ce-8a2d-0b08fa0e5aa5+15417543011231.210.115.166Acme IncRandom-value4Random-value4
87Karylin Gaunsonkgaunson6@tripod.comd24cac79-c81b-4b84-a33e-0441b7c6a981+15417543011160.189.41.11Acme IncRandom-value5Random-value5
98Jamison Shentonjshenton7@upenn.edu29a7a8c0-c7f7-4af9-852f-761b1a784a7a+1541754301153.94.18.201Acme IncRandom-value6Random-value6
109Gavan Threlfallgthrelfall8@spotify.com847d4943-ddb5-47cc-8008-ed5092c675c5+1541754301118.87.247.249Acme IncRandom-value7Random-value7
1110Katina Hemmingwaykhemmingway9@ameblo.jp8f0b5efd-b6a8-4f1e-a1e3-b0ea8c9e3048+1541754301125.191.96.124Acme IncRandom-value8Random-value8
1211Jillian Deinhardjdeinharda@canalblog.combd952787-1b05-411f-9975-b916ec0950cc+1541754301111.211.174.93Acme IncRandom-value9Random-value9
1312Blake Findenbfindenb@wsj.com12c95613-e49d-4fa2-86fb-deabb6ebe600+1541754301147.26.205.153Acme IncRandom-value10Random-value10
1413Liane Maxworthylmaxworthyc@un.org36b68e4c-40d6-4e09-bf59-7db3b27b18f0+15417543011157.196.34.166Acme IncRandom-value11Random-value11
1514Martynne Ledleymledleyd@sourceforge.net1856bceb-cb36-415c-8ffc-0527f3f750d8+15417543011109.231.152.148Acme IncRandom-value12Random-value12
1615Katharina Rufflikrufflie@huffingtonpost.com604de5c9-b154-4279-8978-41fb71f0f773+1541754301120.43.146.179Acme IncRandom-value13Random-value13
1716Tucker Simmancetsimmancef@bbc.co.uk0a8fc3a7-4986-4a51-a503-6c7f974c90ad+15417543011179.76.226.171Acme IncRandom-value14Random-value14
1817Wenona Martinsonwmartinsong@census.gov0e5ea6e3-6824-4e78-a6f5-672847eafa17+1541754301192.243.194.160Acme IncRandom-value15Random-value15
1918Gretna Vedyasovgvedyasovh@lycos.com6becf55b-a7b5-48f6-8788-b89cae85b066+1541754301125.22.86.101Acme IncRandom-value16Random-value16
2019Lurline Abdonlabdoni@archive.orgafa9429f-9034-4b06-9efa-980e01906ebf+15417543011150.249.116.118Acme IncRandom-value17Random-value17
2120Fiann Norclifffnorcliffj@istockphoto.com59f72dec-14ba-4d6e-b17c-0d962e69ffac+15417543011237.167.197.197Acme IncRandom-value18Random-value18
2221Zed Linnzlinnk@phoca.cz95f7bc56-be92-4c9c-ad58-eff3e63c7bea+1541754301188.102.64.113Acme IncRandom-value19Random-value19
2322Averyl Simysonasimysonl@livejournal.combde1fe59-c9bd-440c-bb39-79fe61dac1d1+15417543011141.248.89.29Acme IncRandom-value20Random-value20
2423Camella Blackaddercblackadderm@nifty.com0c981752-5857-487c-b9b5-5d0253df740a+15417543011118.123.138.115Acme IncRandom-value21Random-value21
2524Aurie Spatigaspatign@printfriendly.com4cf22bfb-2c3f-41d1-9993-6e3758e457ba+15417543011157.45.102.235Acme IncRandom-value22Random-value22
2625Adrienne Bellardabellardo@cnn.comf10f9b8d-38ac-4e17-8a7d-d2e6a055f944+15417543011170.73.198.47Acme IncRandom-value23Random-value23