Job-level scoping for tag-based action flow conditions

Objective

  • Tag-based action flow conditions should be able to evaluate against any contact on the job, not only the current email/SMS recipient.
  • Example: When any contact on the workorder has a VIP agent tag, send an office-facing email—even if the recipient being evaluated does not have that tag.
  • Teams should not have to duplicate flows or work around recipient-only tag checks when the business rule is job-wide.

Background

  • Product feedback (Southwest): a VIP agent tag should trigger an office email when any contact on the job has the tag, but the email does not fire because the condition only evaluates against the recipient.
  • Today, email and SMS evaluate many conditions per recipient with people: [recipient] while some attributes use _conditionScopePeople for full-roster context (see contact-already-on-job in attributePathResolver.ts).
  • The tags attribute resolver in attik-backend/src/util/functions/actionFlows/attributePathResolver.ts flattens tags from contacts on inspection.people; when evaluation is recipient-scoped, only that recipient’s tags are visible unless scope is widened.
  • This is a condition scoping product gap, not a one-off misconfiguration. Related work on duplicate/role conditions is tracked separately (see Related).

Scope

Product / UX

  • Decision needed: Job-level vs recipient-level scope per condition type (tags only first, or a general “evaluate on job” mode for multiple attributes).
  • Decision needed: For job-level tag rules on multi-recipient actions, should the action send once (office) vs per recipient—product behavior for non-recipient targets.
  • Expose scoping clearly in the action flow condition UI (attik-frontend/src/components/conditions/templatingData.ts).

Backend

  • Tag resolution: attributePathResolver.tstags resolver and how it behaves with _conditionScopePeople vs people: [recipient].
  • Evaluation: conditionsResolver.ts; per-recipient paths in renderEmail.ts and renderSms.ts (recipient mock job + _conditionScopePeople pattern).
  • Condition catalog: templatingData.ts / backendTemplatingData.tstags condition metadata.
  • Tests: Recipient without tag + another job contact with tag → job-scoped condition passes; recipient-only scope fails (documents current vs desired).

Out of scope

  • Role-replacement bug: ATT-1485.
  • Role-to-role duplicate send/block rules: ATT-1698.

References

  • ATT-1485
  • ATT-1698
  • attik-backend/src/util/functions/actionFlows/attributePathResolver.ts (tags)
  • attik-backend/src/util/functions/emailBuilder/renderEmail.ts
  • attik-backend/src/util/functions/actionFlows/renderSms.ts
  • attik-frontend/src/components/conditions/templatingData.ts

Please authenticate to join the conversation.

Upvoters
Status

Canceled

Board
🏠

Main App

Date

12 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.