Exclude users from users list in issue tracking I'm trying to implement an issue tracking application with Drupal.

I have 4 clients and I want that each one of them will be able to access the site and add an issue.
I filter the project ID so any client see only his project issues.

The only thing I don't get how to do is to assign an issue.

In the "Issue" content type I created a "user Reference" filed called "Assign To" (which cause to Rules to send an email to the assigned user).

I want to be able to assign an issue to any client, but I want a client to be able to assign an issue only to me.

How can I do that?
If I can't exclude some users from the list (say-by role) - do you have any idea about different way to achieve the "Assign To" functionality?
Since your needs are so specific, I think the easiest (and maybe most logical) way to do this is not to restrict the users on the list. Instead, hide the field for all users of a certain role and have the value default to you. And for you, just don't hide it.

You can achieve this in a few ways. It would be very simple to write a custom module to do this. Use hook_form_alter() to access your issue form. In that function, use the global $user object to check the role of the current user, and  if it's your clients' role, set the '#access' property to FALSE and the '#value' to your user id. That's all.

You can probably do this without custom code also. Every field already has a default value in Drupal core. Set the default value for that field to you. Then use a module like Field Permissions to hide the field from your clients.

This achieves what you want without actually messing with the user reference list. That is also an option, but seems like a worse option to me. To do that, you would need a custom hook_form_alter() that, depending on the current user's role, would loop through the #options for that field and remove any users that aren't you.