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

issues relation on user is misleading #317

Closed
xrisk opened this issue Mar 25, 2023 · 7 comments
Closed

issues relation on user is misleading #317

xrisk opened this issue Mar 25, 2023 · 7 comments
Assignees
Labels

Comments

@xrisk
Copy link

xrisk commented Mar 25, 2023

redmine.user.get(...).issues searches on the assigned_to field which might not be what the user expects.

@maxtepkeev maxtepkeev self-assigned this Apr 1, 2023
@maxtepkeev
Copy link
Owner

@xrisk Yep, user.issues currently returns issues user has been assigned to, and as far as I understand you were expecting it to return issues that user has authored, am I right ?

Both scenarios are perfectly valid and I've chosen the first one for user.issues just because it's the most common one, but you're right that it can be confusing, so we can probably come up with 2 relations here like:

  1. redmine.user.get(...).issues_authored
  2. redmine.user.get(...).issues_assigned

Just maybe we need to think of more short and clear relation names here...

@misilot
Copy link
Contributor

misilot commented Aug 8, 2023

Would something like the following make sense?

  • redmine.user.get(...).issues.assigned
  • redmine.user.get(...).issues.reporter

@xrisk
Copy link
Author

xrisk commented Aug 10, 2023

@misilot I’m not very conversant with the Django ORM, but as far as I understand, .issues should be a relation from users -> issues. The question is, should that relation be on the basis of author, or assignee?

issues.assigned or issues.reporter doesn’t make sense to me, as those are not relations on issues.

@maxtepkeev
Copy link
Owner

maxtepkeev commented Aug 10, 2023

I'm with @xrisk here, it should be a direct relation like I described above, actually @xrisk could you please tell me if names like I mentioned make sense to you or you would prefer some other names or solution to the problem ?

@xrisk
Copy link
Author

xrisk commented Aug 10, 2023

Yes, those names do sound good. But I did find that the redmine issues api doesn’t actually have a filter for authored_by (https://www.redmine.org/projects/redmine/wiki/Rest_Issues). I had to directly query the database when I needed to do this.

@maxtepkeev
Copy link
Owner

@xrisk Thanks, actually it does, you need to use author_id for that, so we shouldn't have any problems with implementing this feature, it's just that the page you mentioned doesn't have all possible filters Redmine support.

@maxtepkeev
Copy link
Owner

maxtepkeev commented Mar 2, 2024

Fixed in b595d0b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants