Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export resource_class_map and fix bug in Role.add_user() #1047

Conversation

wlupton
Copy link
Contributor

@wlupton wlupton commented May 18, 2021

The reason for exporting resource_class_map is to allow an external module to support additional resource types without the need to edit resources.py (I had edited it previously but this became a maintenance nightmare).

The Role.add_user() bug is (I hope) an obvious one: the groups argument was ignored.

(This is a duplicate of PR #1002.)

The reason for exporting resource_class_map is to allow an external module to support additional resource types without the need to edit resources.py (I had edited it previously but this became a maintenance nightmare).

The Role.add_user() bug is (I hope) an obvious one: the groups argument was ignored.
Copy link
Collaborator

@adehad adehad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified with the API documentation that group is the right parameter. Happy for this to get merged.

Cloud:

https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-role-actors/#api-rest-api-2-project-projectidorkey-role-id-post

  • Posting to the /rest/api/2/project/{projectIdOrKey}/role/{id} endpoint
  • image

Server/Data Center

https://docs.atlassian.com/software/jira/docs/api/REST/8.13.6/#api/2/project/{projectIdOrKey}/role-addActorUsers

  • Posting to the /rest/api/2/project/{projectIdOrKey}/role/{id} endpoint
  • image

@wlupton
Copy link
Contributor Author

wlupton commented May 20, 2021

I think you are quoting two different endpoints?

  • /rest/api/2/role/{id} relates to global role definitions
  • /rest/api/2/project/{projectIdOrKey}/role/{id} relates to a project's roles (which must be selected from the global roles)

(I've only ever used the server endpoint.)

@adehad
Copy link
Collaborator

adehad commented May 20, 2021

Ah yes. My mistake. I've updated the original approving comment.

@adehad adehad requested a review from ssbarnea May 23, 2021 11:46
@ssbarnea ssbarnea merged commit ba9eb2d into pycontribs:master May 24, 2021
@wlupton wlupton deleted the feature/proposed-api-extensions-copy branch May 24, 2021 13:51
svermeulen pushed a commit to svermeulen/jira that referenced this pull request Oct 31, 2021
…1047)

The reason for exporting resource_class_map is to allow an external module to support additional resource types without the need to edit resources.py (I had edited it previously but this became a maintenance nightmare).

The Role.add_user() bug is (I hope) an obvious one: the groups argument was ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants