Skip to content

fix: pass ticket_brand_id in LURF autocomplete request#759

Merged
zendesk-navkumar merged 1 commit intomasterfrom
navkumar/CRYSTAL-888-brand-lurf-filter
Feb 26, 2026
Merged

fix: pass ticket_brand_id in LURF autocomplete request#759
zendesk-navkumar merged 1 commit intomasterfrom
navkumar/CRYSTAL-888-brand-lurf-filter

Conversation

@zendesk-navkumar
Copy link
Contributor

@zendesk-navkumar zendesk-navkumar commented Feb 26, 2026

Description

When a lookup relationship field (LURF) has a brand-scoped filter condition (ticket_brand_id), the autocomplete API request was sending the filter parameter with an empty value. This is because brandId was available as a prop in NewRequestForm but was not passed through to LookupField, and the filter loop was not distinguishing between ticket_fields_* and ticket_brand_id filter types.

This fix:

  • Adds brandId as an optional prop to LookupField
  • Passes brandId from RequestFormField to LookupField
  • Separately handles ticket_brand_id by checking if the filter includes a brand condition and the brandId is available, then sets filter[dynamic_values][ticket_brand_id] with the actual brand ID
  • Adds brandId to the useCallback dependency array

Screenshots

N/A — API-level change, no UI changes.

References

Checklist

  • 📗 all commit messages follow the conventional commits standard
  • ⬅️ changes are compatible with RTL direction
  • ♿ Changes to the UI are tested for accessibility
  • 📝 changes are tested in Chrome, Firefox, Safari and Edge
  • 📱 changes are responsive and tested in mobile
  • 👍 PR is approved by @zendesk/vikings

When a lookup relationship field has a brand filter condition
(ticket_brand_id), the autocomplete API request now includes the
brand ID from the current Help Center brand. Previously the filter
was sent with an empty value because brandId was not wired through
to the LookupField component.

- Add brandId prop to LookupField
- Pass brandId from RequestFormField to LookupField
- Add startsWith("ticket_fields_") guard to skip non-field filters
- Add ticket_brand_id to search params when brand filter is defined
- Add tests for ticket_brand_id filter handling

CRYSTAL-888
@zendesk-navkumar zendesk-navkumar merged commit 62fdf2a into master Feb 26, 2026
8 checks passed
@zendesk-navkumar zendesk-navkumar deleted the navkumar/CRYSTAL-888-brand-lurf-filter branch February 26, 2026 13:13
@zd-svc-github-copenhagen-theme
Copy link
Collaborator

🎉 This PR is included in version 4.30.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants