Recipe: Assignment Control app for App Builder | The place for Zendesk users to come together and share
Skip to main content
Vishal Jethani
Product Manager
Apr 23, 2026 10:26 AM UTC

Recipe: Assignment Control app for App Builder

Problem Statement

The Assignment Control app is a ticket sidebar application that provides targeted visibility controls for the ticket assignee dropdown. It dynamically hides specific agents and groups based on configurable targeting rules, such as the current agent's role, group membership, ticket attributes etc.

 

Locations: ticket sidebar, new ticket sidebar

 

Prompt

Create a ticket_sidebar app called "Assignment Control" that hides specific agents and groups from the ticket assignee dropdown, based on whether the current agent matches configurable targeting rules.

For the locations of ticket sidebar, new ticket sidebar

Define six app parameters in the manifest so they appear on the app's installation settings screen (all type: text, all optional):

  • `hidden_user_ids` — labelled "Hidden users". Help text: "A comma-separated list of user IDs to be hidden from the Assignee dropdown."
  • `hidden_group_ids` — labelled "Hidden groups". Help text: "A comma-separated list of group IDs to be hidden from the Assignee dropdown."
  • `targeted_user_ids` — labelled "Targeted users". Help text: "A comma-separated list of user IDs that are targeted to have assignees hidden."
  • `targeted_user_tags` — labelled "Targeted user tags". Help text: "A comma-separated list of user tags that are targeted to have assignees hidden."
  • `targeted_organization_ids` — labelled "Targeted organizations". Help text: "A comma-separated list of organization IDs that are targeted to have assignees hidden."
  • `targeted_group_ids` — labelled "Targeted groups". Help text: "A comma-separated list of group IDs that are targeted to have assignees hidden."

Read these at runtime via the app registration event metadata at `metadata.settings`.

  1. On load, invoke `zafClient.invoke('hide')` to hide the app from the sidebar UI.
  2. On load, first call `zafClient.get('currentUser.organizations')` to prime the organizations data, then call `zafClient.get('currentUser')` to get the full current user object including `id`, `tags`, `organizations` (array of objects with `id`), and `groups` (array of objects with `id`).
  3. Parse each "targeted" setting by splitting on commas, trimming whitespace, and filtering out empty strings. Ignore settings that are empty or not configured. Determine if the current user is targeted by checking if ANY of these conditions is true: their user ID (converted to a string via `String(id)`) is in `targeted_user_ids`, any of their tags is in `targeted_user_tags`, any of their organization IDs (converted to strings) is in `targeted_organization_ids`, or any of their group IDs (converted to strings) is in `targeted_group_ids`. If no targeted settings are configured or none match, display "Assignment Control — not active for your account" and stop.
  4. If the current user IS targeted, fetch the assignee field by calling `zafClient.get('ticketFields:assignee')`. IMPORTANT: the string `ticketFields:assignee` uses a colon between `ticketFields` and `assignee` — this is ZAF SDK ticket field syntax, not a dot. The response is an object keyed by the exact string `ticketFields:assignee`, so you MUST access it with bracket notation: `response['ticketFields:assignee']`. From that object, read `optionGroups` (array) and `optionValues` (array).
  5. Parse `hidden_group_ids` as a comma-separated trimmed list (filter out empty strings). For each entry in the `optionGroups` array, its `value` property is a string in the format `"groupId:userId"`. Split on `:` and take the first segment as the group ID. If that group ID is in the hidden list, call `zafClient.invoke('ticketFields:assignee.optionGroups.{index}.hide')` where `{index}` is that entry's numeric index in the array. Note: the invoke path uses a colon between `ticketFields` and `assignee` and dots for the rest — for example `ticketFields:assignee.optionGroups.0.hide`.
  6. Parse `hidden_user_ids` as a comma-separated trimmed list (filter out empty strings). For each entry in the `optionValues` array, its `value` property is a string in the format `"groupId:userId"`. Split on `:` and take the second segment as the user ID. If the second segment is missing, treat it as an empty string and skip. If that user ID is in the hidden list, call `zafClient.invoke('ticketFields:assignee.optionValues.{index}.hide')` where `{index}` is that entry's numeric index in the array. Same colon syntax: `ticketFields:assignee.optionValues.0.hide`.
  7. Listen for the event `ticketFields.assignee.optionValues.changed` via `zafClient.on()` (note: the event name uses dots, not colons). When this event fires, re-run steps 4–6 to re-apply hiding, because the available assignees change when the ticket's group changes.

Enhancement Options

Based on your organizational needs, you can extend the Assignment Control app to support your specific needs using App Builder.

 

Important Note: This app recipe is for the Assignment Control app. Any modifications to the recipe or its underlying logic may alter the core functionality of the app. Thoroughly test all changes in a non-production environment before deploying to your production workspace.

Please note: that as App Builder evolves including updates to underlying AI models, design components, and other dependencies, we cannot guarantee that this recipe will continue to function as expected over time. We recommend periodically validating the recipe against any platform updates.

10 replies

Ondrej12
Newcomer
Jun 4, 2026 11:12 AM UTC

Hi all,

I tried recreating the Assignment Control App from this recipe using App Builder and ran into issues getting it to work correctly. The App simply does not hide the groups from the Assignee/Group selector in the ticket interface eventhough the intended group ID is added to the hidden_group_ids field. 


Eventually I was able to make it work only in our testing environment (Sandbox) after some troubleshooting and providing the App Builder with some additional prompts, however when trying to recreate this app in our production environment I am unable to make it work. 
 

If anyone else has seen similar behavior, or if the recipe/app could be reviewed for missing steps or configuration issues, that would be very helpful.

Thanks in advance.

Translate
Aug 14, 2026 4:03 PM UTC

This recipe works great on existing tickets, but does not work when creating new tickets. I have tried over and over again to have App Builder correct the issue with no luck. If you could provide an update to the prompt that will solve this problem that would be greatly appreciated. We really need this app.

Translate
Newcomer
Sep 3, 2026 9:05 PM UTC

When you’re first creating the app in App Builder there’s a screen that pops up to “Approve the Plan”. On that screen, toward the bottom there’s a section called App Location with a button that says Change Location. The option currently selected is most likely Ticket Sidebar. When you click on Change Location you’ll see Ticket Sidebar and a checkbox under it says Include New Ticket Sidebar. Check that option and it should work for New Tickets as well.

Also a cool mod that I added to the App was to have it hide Groups based on a prefix on the Group Name instead of by Group ID. So if I name a group ACL-GroupName or VIEW-GroupName then it gets dynamically included to be hidden because of the ‘ACL-’ or ‘VIEW-’ prefix. Now I don’t have to keep going back into this app and adding Group IDs to the Hidden Groups List.

Translate
Aug 15, 2026 12:16 PM UTC

I think the issue may be related to how the App Builder recipe is being recreated rather than the basic logic itself. The recipe specifically depends on the ticketFields:assignee ZAF syntax and on re-running the hiding logic whenever ticketFields.assignee.optionValues.changed fires.

Since it works in the Sandbox but not in production, I’d compare the app configuration and installation settings between the two environments first. In particular, check that the hidden_group_ids value is being passed correctly and that the app is actually reading its installation settings from metadata.settings.

I’d also test the generated app in a non-production environment before making further changes. Zendesk recommends testing app changes carefully, and App Builder apps can be refined through additional prompts if the initial implementation doesn't behave as expected.

Once the assignment behavior is working reliably, you could use the same app-building approach for other internal workflows, even simple web-based tools like candyjump.io or papasbakeria.io, although those would obviously be separate from the Zendesk assignment logic.

Translate
Oct 5, 2026 10:03 AM UTC

I understand Zendesk want to encourage use of the App Builder but I also don’t quite understand why the community is being asked to recreate a fairly rudimentary function hundreds of times over and over again, with varying levels of success. Can anyone share a working rendition of the app generated by this prompt to reduce the time and resource investment to create this same exact app over and over again?

“we cannot guarantee that this recipe will continue to function as expected over time” You can say that again, based on the comments!

Translate
Daniel68
Newcomer
Oct 8, 2026 9:10 PM UTC

This was a nightmare to get working!  Having to prompt and re-prompt the App Builder.  Once working used the working version in (asked) App Builder to recreate a prompt that would work.  Initial version still didn’t work.  Now have prompt that works, sharing here.  Yes, during “Approve the plan” ensure you set App location to include “New Ticket Sidebar”.  I also choose to accept (tick) all other features offered.  

Build a Zendesk Support app titled Assignment Control.

Goal
Apply assignee hiding for targeted agents on existing tickets and tickets being created in Zendesk Agent Workspace. The app must not remain visible in the sidebar.

Locations and visibility
- Configure both Support locations in the app manifest: ticket_sidebar and new_ticket_sidebar.
- Keep these locations because the app must access the ticket’s assignee field and options. Do not use background as a replacement; background apps don’t have direct access to ticket-specific properties.
- Hide the app as soon as its ZAF client is registered by calling the documented `client.invoke('hide')` action. Hide it again when it becomes active, if needed.
- Do not call `show`.
- Render no visible UI, text, status, or controls.
- Don’t treat rendering nothing as sufficient. The app must invoke the ZAF hide action so the app itself isn’t left visible in the sidebar.
- Keep the app’s logic running after it is hidden so it can process ticket field data and events.

Installation settings
Add these six settings:
- hidden_user_ids
- hidden_group_ids
- targeted_user_ids
- targeted_user_tags
- targeted_organization_ids
- targeted_group_ids

Read these non-secure settings from ZAF metadata. Parse list values consistently, including comma-separated values and whitespace trimming.

Targeting rules
- Use documented ZAF APIs to read the current user’s ID, tags, organizations, and groups.
- Apply hiding only when the current agent matches the configured targeting rules.
- Match configured targeted user IDs, tags, organization IDs, and group IDs using the app’s established targeting behavior.
- If no targeting criteria are configured, don’t hide assignee options.

Ticket and assignee handling
- On app registration in both sidebar locations, install event listeners and run an initial pass against the current ticket field data.
- The initial pass is required for existing tickets and newly created tickets; don’t wait for a change event before applying hiding.
- Read the assignee field’s `optionGroups` and `optionValues`.
- Assignee values use `groupId:userId`; group-only values may use `groupId:0`.
- For a targeted agent, hide group headings that match `hidden_group_ids` by their optionGroups index.
- Hide selectable assignee options that match `hidden_user_ids` or belong to a group in `hidden_group_ids` by their optionValues index.
- Preserve index-based hiding for both group headings and selectable options. Use the corresponding `ticketFields:assignee` hide actions and don’t silently omit group-heading hiding.
- Listen for `ticketFields.assignee.optionValues.changed` and re-read the current options and reapply the hiding. Also handle relevant ticket assignee changes where needed.
- Register listeners before starting asynchronous reads so early option changes aren’t missed.
- Re-run the initial pass for each loaded ticket or new-ticket context.

Validation
- Confirm the app is configured for both ticket_sidebar and new_ticket_sidebar.
- In preview, verify it hides itself and still applies the configured hiding on an existing ticket.
- Verify the same behavior while an agent is creating a ticket in Zendesk Agent Workspace, before the ticket is submitted.
- Confirm the app doesn’t stay visible in either sidebar location.
- Don’t report success if the app only hides options on existing tickets or only hides its own UI without applying the assignee rules.

Implementation requirements
- Use documented ZAF APIs and look up their documentation before writing ZAF calls.
- Keep application logic in App.jsx and reusable targeting and assignee logic in utils/assignmentControl.js.
- Include mock.js with plain JavaScript only, matching the ZAF methods and response shapes used by the app. Don’t import mock.js into application code.
- Don’t add external services or REST requests; use ZAF APIs for this functionality.
- Keep blueprint.json and the changelog in sync, and compile the app before finalizing.

Hopefully saves others some time.

Translate
anneard
Oct 9, 2026 7:11 AM UTC

I have had similar experiences - where the “Test” mode of App Builder functions yet completely breaks after publishing the app. I’ve switched to a workflow where I have to publish and republish the app with access limited to an App Testing Group for actual testing. I’m curious if we can get a good version and upload a link to a good version of the app here as a successor to the main app that’s being retired.

Translate
Daniel68
Newcomer
Nov 4, 2026 9:11 PM UTC

Hi Curtis11,

Did you find any issues with the app after using the copy of the prompt that I’ve shared above?  Be great to know because if their are we have them now.  Thank you

Translate
anneard