Hi everyone,
I have a User Picker custom field in Jira Cloud.
My requirement is:
The User Picker should display all users.
However, users should be able to select only 3 specific users.
If they try to select any other user, the selection should be prevented.
I've explored:
ScriptRunner Behaviours
Jira Automation
Script Listeners
Scripted Fields
From what I've found, ScriptRunner Cloud Behaviours don't seem to provide an API to restrict the User Picker or prevent selecting specific users.
If not, is there any official documentation confirming that this is a limitation in Jira Cloud?
Thanks in advance!
Jira Cloud does support filtering User Picker (multiple users) fields by groups or project roles (see JRACLOUD-40963). However, if your requirement is to show all users but only allow selecting 3 specific ones, I don't believe that's currently possible in Cloud. User Picker is tied to Atlassian's identity service, so apps can't override the native search or autocomplete.
Depending on your use case, another option is to use an Assets object field instead of a User Picker. I've used this approach before by storing users as Assets objects and filtering them with AQL, which gives you much more control over who can be selected. It's not a true User Picker, but it can be a good alternative if restricting the available users is the primary goal.
Hope this helps! 💙
Hi @Dev ,
You could maybe explore Forge here 🤔 (although I haven't seen this specific use case, it might be doable if you build a custom solution)
Potentially, instead of actually having to code, you could try out Apps in Studio - quite a cool native feature where you basically prompt Rovo to build a solution for you.
If you do try it out, I'm interested in hearing the results 👀
Also, I browsed JAC for feature requests related to this but couldn't find anything. As this sounds like an interesting thing, it might be worth reaching out to Atlassian Support and discussing your requirement with them. Their team can probably create a new feature request based on it.
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dev
You've analysed the technical options well. Unlike Jira Data Center(where ScriptRunner could inject custom JavaScript into the browser to manipulate fields dynamically), this is a limitation in Jira Cloud as it operates on Atlassian's Forge and Connect platforms
As ScriptRunner Cloud Behaviours rely on Atlassian's UI Modifications REST API, this API currently does not expose endpoints to modify the autocomplete query or restrict option selection for User Picker fields. Adaptavist explicitly documents that Cloud Behaviours are limited by what Atlassian's UI Modifications API supports: Behaviours Limitations
You can try these workarounds, if it helps
Hope it helps and gives you a path forward.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dev,
Unfortantetly Behaviours inside ScriptRunner for Jira Cloud currently doesnt support setting field leve restrictions with a setError() method and I would advise you to raise a feature request for this here so this can be considered.
If the issue is being transitioned through a workflow then writing a workflow validator using ScriptRunner may help and the page here has some example validator scripts that may be helpful.
Workflow validators in Scriptrunner for Jira Cloud use the Jira Expression Language syntax.
Hope this helps.
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dev, the official confirmation you're after is Atlassian's own UI modifications reference. setOptionsVisibility is the only method that filters what a field offers, and the support tables mark it unsupported for user picker and multi user picker in all three views (global issue create, issue view, issue transition). Only option-based types like single select carry it. Cloud Behaviours run on that same API, which is why the hook isn't exposed there either.
setValue is supported on user picker though. I haven't built this exact one, but the pieces are there: a Forge UIM app can hook onChange on the field, read the accountId they picked and set it back to null when it isn't one of the three you allow. The list still shows everyone and the pick gets undone after the fact, which is the closest Cloud gets to deciding this at runtime per logged-in user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dev ,
Are you looking to restrict a "Custom Field" (Single/Multi User Picker) or a "System Field" (Assignee/Reporter)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm referring to a Custom Field (Single User Picker).
My requirement is to dynamically restrict the users that can be selected in this custom User Picker based on the currently logged-in user (or their email/account ID), rather than using Jira Groups or Project Roles.
Is this supported in Jira Cloud, or is it also a platform limitation?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Native dynamic filtering for User Pickers based on the logged-in user is not supported in Jira Cloud. The most practical workaround is using Jira Automation to validate the selection after it's made and clear the field if it violates your logic. While users will still see all names in the dropdown, this "interception" method ensures data integrity with minimal effort.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.