Is that possible to get all user roles available for task? It means projectRoles (projectRoleManager.getProjectRoles()) with custom created roles, but it doesn't contains roles like 'Assaignee', 'Watchers'... I don't want to get concrete users, but user roles.
Those aren't "roles". Atlassian tend to use the word "role" to mean "user role" rather than the "dynamic" or "derived" roles you're talking about.
You can't actually get them from projectRoleManager because they aren't roles at all, and aren't associated with the project - they're functions derived from data.
Could you explain what you're actually trying to do? We might be able to point you in the right direction.
No, that's what I said, there are "roles" in there, but most of what you are looking for are not "roles", they are functions based on information from the project, issue, user-groups and so-on. It's a nonsense to ask for them at a project level, because by their nature, they vary. For example, when you ask for "assignee", what would you expect the project to answer? It can't because assignee is a function of the issues.
To offer those options, you need to do a couple of things:
1) Your code will need to physically add them to whatever you're writing to "offer the choice"
2) Your code will need to replicate or reuse the functionality when actually using them for anything. (e.g. using assignee as the example again, your code will have to say "ah, user selected assignee, that means I need to read each issue for the current assignee")
It may help if you explain what you're trying to do - rather than just say "offer a choice" (that's implied by your question), explain what you want to end up with. Outline roughly what the user gets out of it?
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events