Skip to content

Commit 6e44dcf

Browse files
committed
fix(helpscout): keep team assignee names in connector metadata and tool outputs
1 parent fe98e7a commit 6e44dcf

5 files changed

Lines changed: 23 additions & 2 deletions

File tree

‎apps/docs/content/docs/integrations/helpscout.mdx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,21 @@ List and search Help Scout conversations by inbox, folder, status, tag, assignee
8888
| ↳ `type` | string | user, team, or customer |
8989
| ↳ `first` | string | First name |
9090
| ↳ `last` | string | Last name |
91+
| ↳ `name` | string | Team name, when the person is a team |
9192
| ↳ `email` | string | Email address |
9293
| ↳ `createdBy` | json | User or customer who created the conversation |
9394
| ↳ `id` | number | User, team, or customer ID |
9495
| ↳ `type` | string | user, team, or customer |
9596
| ↳ `first` | string | First name |
9697
| ↳ `last` | string | Last name |
98+
| ↳ `name` | string | Team name, when the person is a team |
9799
| ↳ `email` | string | Email address |
98100
| ↳ `primaryCustomer` | json | Primary customer of the conversation |
99101
| ↳ `id` | number | User, team, or customer ID |
100102
| ↳ `type` | string | user, team, or customer |
101103
| ↳ `first` | string | First name |
102104
| ↳ `last` | string | Last name |
105+
| ↳ `name` | string | Team name, when the person is a team |
103106
| ↳ `email` | string | Email address |
104107
| ↳ `createdAt` | string | When the conversation was created |
105108
| ↳ `closedAt` | string | When the conversation was closed |
@@ -159,18 +162,21 @@ Get a Help Scout conversation by ID, optionally with its threads.
159162
| ↳ `type` | string | user, team, or customer |
160163
| ↳ `first` | string | First name |
161164
| ↳ `last` | string | Last name |
165+
| ↳ `name` | string | Team name, when the person is a team |
162166
| ↳ `email` | string | Email address |
163167
| ↳ `createdBy` | json | User or customer who created the conversation |
164168
| ↳ `id` | number | User, team, or customer ID |
165169
| ↳ `type` | string | user, team, or customer |
166170
| ↳ `first` | string | First name |
167171
| ↳ `last` | string | Last name |
172+
| ↳ `name` | string | Team name, when the person is a team |
168173
| ↳ `email` | string | Email address |
169174
| ↳ `primaryCustomer` | json | Primary customer of the conversation |
170175
| ↳ `id` | number | User, team, or customer ID |
171176
| ↳ `type` | string | user, team, or customer |
172177
| ↳ `first` | string | First name |
173178
| ↳ `last` | string | Last name |
179+
| ↳ `name` | string | Team name, when the person is a team |
174180
| ↳ `email` | string | Email address |
175181
| ↳ `createdAt` | string | When the conversation was created |
176182
| ↳ `closedAt` | string | When the conversation was closed |
@@ -205,18 +211,21 @@ Get a Help Scout conversation by ID, optionally with its threads.
205211
| ↳ `type` | string | user, team, or customer |
206212
| ↳ `first` | string | First name |
207213
| ↳ `last` | string | Last name |
214+
| ↳ `name` | string | Team name, when the person is a team |
208215
| ↳ `email` | string | Email address |
209216
| ↳ `createdBy` | json | User or customer who created the thread |
210217
| ↳ `id` | number | User, team, or customer ID |
211218
| ↳ `type` | string | user, team, or customer |
212219
| ↳ `first` | string | First name |
213220
| ↳ `last` | string | Last name |
221+
| ↳ `name` | string | Team name, when the person is a team |
214222
| ↳ `email` | string | Email address |
215223
| ↳ `assignedTo` | json | User or team assigned by the thread |
216224
| ↳ `id` | number | User, team, or customer ID |
217225
| ↳ `type` | string | user, team, or customer |
218226
| ↳ `first` | string | First name |
219227
| ↳ `last` | string | Last name |
228+
| ↳ `name` | string | Team name, when the person is a team |
220229
| ↳ `email` | string | Email address |
221230
| ↳ `to` | array | To email addresses |
222231
| ↳ `cc` | array | CC email addresses |
@@ -451,18 +460,21 @@ List the threads (customer messages, replies, notes, and activity) of a Help Sco
451460
| ↳ `type` | string | user, team, or customer |
452461
| ↳ `first` | string | First name |
453462
| ↳ `last` | string | Last name |
463+
| ↳ `name` | string | Team name, when the person is a team |
454464
| ↳ `email` | string | Email address |
455465
| ↳ `createdBy` | json | User or customer who created the thread |
456466
| ↳ `id` | number | User, team, or customer ID |
457467
| ↳ `type` | string | user, team, or customer |
458468
| ↳ `first` | string | First name |
459469
| ↳ `last` | string | Last name |
470+
| ↳ `name` | string | Team name, when the person is a team |
460471
| ↳ `email` | string | Email address |
461472
| ↳ `assignedTo` | json | User or team assigned by the thread |
462473
| ↳ `id` | number | User, team, or customer ID |
463474
| ↳ `type` | string | user, team, or customer |
464475
| ↳ `first` | string | First name |
465476
| ↳ `last` | string | Last name |
477+
| ↳ `name` | string | Team name, when the person is a team |
466478
| ↳ `email` | string | Email address |
467479
| ↳ `to` | array | To email addresses |
468480
| ↳ `cc` | array | CC email addresses |

‎apps/sim/connectors/helpscout/helpscout.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const PersonSchema = z
2626
type: z.string().nullable().optional(),
2727
first: z.string().nullable().optional(),
2828
last: z.string().nullable().optional(),
29+
name: z.string().nullable().optional(),
2930
email: z.string().nullable().optional(),
3031
})
3132
.passthrough()
@@ -169,7 +170,12 @@ function resolveMaxConversations(sourceConfig: Record<string, unknown>): number
169170
function personName(person: z.infer<typeof PersonSchema> | null | undefined): string {
170171
if (!person) return 'Unknown'
171172
const name = [person.first, person.last].filter((part) => part?.trim()).join(' ')
172-
return name || person.email || (person.type === 'customer' ? 'Customer' : 'Help Scout user')
173+
return (
174+
name ||
175+
person.name?.trim() ||
176+
person.email ||
177+
(person.type === 'customer' ? 'Customer' : 'Help Scout user')
178+
)
173179
}
174180

175181
function conversationMetadata(conversation: HelpScoutConversation): Record<string, unknown> {

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/helpscout/types.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface HelpScoutPerson {
55
type: string | null
66
first: string | null
77
last: string | null
8+
name: string | null
89
email: string | null
910
}
1011

@@ -197,6 +198,7 @@ const PERSON_PROPERTIES = {
197198
type: { type: 'string', description: 'user, team, or customer', nullable: true },
198199
first: { type: 'string', description: 'First name', nullable: true },
199200
last: { type: 'string', description: 'Last name', nullable: true },
201+
name: { type: 'string', description: 'Team name, when the person is a team', nullable: true },
200202
email: { type: 'string', description: 'Email address', nullable: true },
201203
} as const satisfies Record<string, OutputProperty>
202204

‎apps/sim/tools/helpscout/utils.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ function projectPerson(value: unknown): HelpScoutPerson | null {
140140
type: toStringOrNull(data.type),
141141
first: toStringOrNull(data.first),
142142
last: toStringOrNull(data.last),
143+
name: toStringOrNull(data.name),
143144
email: toStringOrNull(data.email),
144145
}
145146
}

0 commit comments

Comments
 (0)