ctreminiom / go-atlassian

✨ Golang Client Library for Atlassian Cloud.
https://docs.go-atlassian.io
MIT License
131 stars 34 forks source link

Find users assignable to projects + query #223

Open imilchev opened 1 year ago

imilchev commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to get a list of users that are assignable to a project but I would also like to apply a query to the list. This is useful whenever there are many Jira users in a specific project and one would try to find a specific user from that list. The current interface doesn't have a function that allows writing such a request.

Describe the solution you'd like I would like to have a function similar to Projects (as defined here) but that also allows me to specify the query parameter.

I already saw in the Jira API docs that such a request is possible. It's just a matter of exposing it in the library API.

Describe alternatives you've considered none

Additional context I am happy to open a PR implementing this if you could provide some guidance on the right approach. I would assume that simply adding an extra parameter to the existing Projects function won't be a good idea because that would be a breaking change.

Creating a new function for this feature would work too but then I'm not sure what a good name for it would be. I'm open for suggestions

ctreminiom commented 1 year ago

Hi @imilchev, thank you for the interest on this project.

I think the best method name would be ByProjects(), using the naming convention By + $Jira_Entity_In_Plural, and taking into account the other methods has not been mapped on the library. image

So, it'll be easier for the dev's using these methods:

I'm aware the endpoint is already mapped on the library, but not the params are mapped and changing it will results on a breaking change.

Also, you're free to open a new PR, but right now I'm working on migrating the client interface to a new one and the architecture changes may affects your PR with the changes I've done. https://github.com/ctreminiom/go-atlassian/pull/224.