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

/reports/activity search? #14495

Closed
snipe opened this issue Mar 26, 2024 Discussed in #14480 · 11 comments
Closed

/reports/activity search? #14495

snipe opened this issue Mar 26, 2024 Discussed in #14480 · 11 comments

Comments

@snipe
Copy link
Owner

snipe commented Mar 26, 2024

Discussed in #14480

Originally posted by ShaunNeighbourSwale March 25, 2024
Hi All

I'm looking at grabbing a filtered activity report. Ideally I'd like to exclude one particular admin from the results.

https://snipe-it.readme.io/reference/reportsactivity says that a search term can be specified. Any idea of allowed search string formats?

If it's no possible to exclude an admin, I could merge reports for every other admin. Any idea which search term would specify an admin?

Thanks!

Copy link

welcome bot commented Mar 26, 2024

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

The bigger issue here is that we're not set up (yet) to allow you to exclude things from searches - and more importantly, however we decide to do that, we can't change it down the line, so it has to be really well thought out and as future-proof as we can make it. The search currently works the same as the other searches within the system, where it will just take a string and try to match it via a LIKE query across multiple columns/tables.

For now, I can add user_id as a specifiable field - would that work for you for the time being?

@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

👋 Thanks for opening your first issue here!

lol go home welcome-bot - you're drunk.

@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

ping @ShaunNeighbourSwale for discussion

@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

Like, I can do a quick fix for you for this, something like except_admin=1, but I want to make sure the shape of this API change actually makes sense for when people want to exclude other things. This is something we've been discussing internally for quite some time - a more boolean way to interact with the API. This does get into sticky territory where we end up writing a SQL parser, but I think it's worth considering. We just need to figure out how exactly we want to handle it, and perhaps more importantly, how people can use it within the tables themselves, which only pass a search variable.

@ShaunNeighbourSwale
Copy link

user_id would get me out of a huge hole!

@ShaunNeighbourSwale
Copy link

Like, I can do a quick fix for you for this, something like except_admin=1, but I want to make sure the shape of this API change actually makes sense for when people want to exclude other things. This is something we've been discussing internally for quite some time - a more boolean way to interact with the API. This does get into sticky territory where we end up writing a SQL parser, but I think it's worth considering. We just need to figure out how exactly we want to handle it, and perhaps more importantly, how people can use it within the tables themselves, which only pass a search variable.

That makes sense - I'm happy to run multiple searches for each individual admin for the time being if that works for you, and helps others. I doubt many people are in my exact scenario, where a script is responsible for the majority of the activity, and management want a report on all activity excluding ShaunBot.

@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

You'd probably be surprised - we've seen alllll kinds of implementations here! Adding user_id is trivial and I can ship that today, so let's at least start with that. Then as the discussion goes on internally, we can see how we want to more organically exclude results, allow arrays of things, etc.

@ShaunNeighbourSwale
Copy link

Thank you!

snipe added a commit that referenced this issue Mar 26, 2024
Fixed #14495 - Allow user_id to be passed to limit to only specific admins
@snipe snipe closed this as completed in 3ced850 Mar 26, 2024
@snipe
Copy link
Owner Author

snipe commented Mar 26, 2024

This is now on master - give it a go :)

@ShaunNeighbourSwale
Copy link

That works! Thank you!

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

No branches or pull requests

2 participants