You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API endpoints /hardware/audit/due and /hardware/audit/overdue are returning always all assets and not just those which are due or overdue for an audit, as documented.
The issue seems to persist since a while. I accidentally used Snipe-IT v6.4.1 in a test installation and reproduced it. But also 7.0.11 has the same issue.
I saw in the source that this an legacy API and the new APIs are /hardware/audits/due, /hardware/audits/overdue and /hardware/audits/due-or-overdue, which work as expected. However, the docs is still mentioning the old API.
Reproduction steps
Ensure in Settings -> Notification that "Audit Interval" is defined.
Create a new asset or edit an existing asset. Ensure that the attribute "Next Audit Date" is way in the future, after the configured audit interval
Create yourself an API token
curl -H 'Authorization: Bearer <api token>' https://<server>/api/v1/hardware/audit/due | jq (or any other tool of your choice). You can see that your asset, which should not be due for audit, is listed, among any other assets which may exists.
Expected behavior
The APIs /hardware/audit/due and /hardware/audit/overdue should only return assets which are actually due or overdue for audit. The result should be comparable to the APIs /hardware/audits/due and /hardware/audits/overdue.
Screenshots
No response
Snipe-IT Version
6.4.1, 7.0.11
Operating System
Debian 12, Docker
Web Server
Apache
PHP Version
8.1.2, 8.3.8
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
Is this a fresh install or an upgrade? Discovered on a existing system, confirmed in a fresh docker installation version 6.4.1 and 7.0.11
What method you used to install Snipe-IT: manual and docker
Indicate whether or not you've manually edited any data directly in the database: nope
The text was updated successfully, but these errors were encountered:
👋 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.
samuelb
changed the title
/hardware/audit/{due,overdue} API returning all assets, not just those wher the audit is due
/hardware/audit/{due,overdue} API returning all assets, not just those which are due for an audit
Sep 24, 2024
Debug mode
Describe the bug
The API endpoints
/hardware/audit/due
and/hardware/audit/overdue
are returning always all assets and not just those which are due or overdue for an audit, as documented.The issue seems to persist since a while. I accidentally used Snipe-IT v6.4.1 in a test installation and reproduced it. But also 7.0.11 has the same issue.
I saw in the source that this an legacy API and the new APIs are
/hardware/audits/due
,/hardware/audits/overdue
and/hardware/audits/due-or-overdue
, which work as expected. However, the docs is still mentioning the old API.Reproduction steps
curl -H 'Authorization: Bearer <api token>' https://<server>/api/v1/hardware/audit/due | jq
(or any other tool of your choice). You can see that your asset, which should not be due for audit, is listed, among any other assets which may exists.Expected behavior
The APIs
/hardware/audit/due
and/hardware/audit/overdue
should only return assets which are actually due or overdue for audit. The result should be comparable to the APIs/hardware/audits/due
and/hardware/audits/overdue
.Screenshots
No response
Snipe-IT Version
6.4.1, 7.0.11
Operating System
Debian 12, Docker
Web Server
Apache
PHP Version
8.1.2, 8.3.8
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
The text was updated successfully, but these errors were encountered: