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

Get an issue's watchers #334

Open
pkoevesdi opened this issue Dec 15, 2023 · 4 comments
Open

Get an issue's watchers #334

pkoevesdi opened this issue Dec 15, 2023 · 4 comments
Labels
enhancement pending: missing api Issue is pending because a Redmine API is missing

Comments

@pkoevesdi
Copy link

pkoevesdi commented Dec 15, 2023

How can one get the current watchers of an issue? Is there any implemented way, other than using the low level API? If not, I'd like to put this as an feature request. Thank You very much!

@Art4
Copy link
Collaborator

Art4 commented Dec 16, 2023

Since Redmine 2.3.0 you can include the watchers in the issues details, see https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Showing-an-issue

Using the mid level API it should work like this:

$client->getApi('issue')->list([
    'include' => [
        'watchers',
    ],
]);

@pkoevesdi
Copy link
Author

pkoevesdi commented Dec 16, 2023

That's similar to what I tried (passed 'watchers' as string, not list), but no luck, still no watchers in the Array.
To clarify my problem: I can show them for a certain issue $client->getApi('issue')->show($issueId);, but not inside a list of issues.

@Art4
Copy link
Collaborator

Art4 commented Dec 17, 2023

You are right. Including the watchers to a list of issues is missing in the Redmine API atm. I've found this feature request: https://www.redmine.org/issues/36848

As a workaorund you could call every issue in a separate call with included watchers. But this might become very costly.

@Art4 Art4 added pending: missing api Issue is pending because a Redmine API is missing and removed question labels Dec 17, 2023
@pkoevesdi
Copy link
Author

But this might become very costly.

Yes, definately, with a list of 6000 issues that need to be filtered by watchers over network, it takes too long.
Sadly, one of the many open feature requests of redmine. Thanks for pointing there. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pending: missing api Issue is pending because a Redmine API is missing
Projects
None yet
Development

No branches or pull requests

2 participants