It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira - user roles


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.

1 answer

1 vote

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.

I have to offer choice of group like 'testers', 'assaignees', 'watchers', 'administrators'. I thought I could get that roles by one method...

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?

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 09, 2019 in Portfolio for Jira

Portfolio for Jira 3.0 is here!

The wait is over... Portfolio for Jira Server and Data Center 3.0 is now officially here! Platform releases offer Atlassian an opportunity to shift our strategy, make bold predictions about t...

1,343 views 14 25
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you