8326: Fix the Leantime ticket search and user directory - #110
Open
turegjorup wants to merge 1 commit into
Open
turegjorup wants to merge 1 commit into
turegjorup wants to merge 1 commit into
Conversation
searchCriteria.status was sent as a list; Leantime wants one scalar and answers -32000 Server error to an array, which is why the page showed only a flash. And users.getAll answers -32001 for our key, so the directory now comes from the ITK data-api plugin, which serves the same id/name/email over the key we already hold.
API Specification - Non-breaking changesNo changelog changes |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/log-leantime-api-errors #110 +/- ##
=====================================================================
+ Coverage 41.13% 42.32% +1.18%
- Complexity 1133 1138 +5
=====================================================================
Files 150 150
Lines 3588 3615 +27
=====================================================================
+ Hits 1476 1530 +54
+ Misses 2112 2085 -27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/8326
Description
Two independent failures, both on the repo advisories page.
searchCriteria.statuswas sent as an array. Leantime wants one scalar and answers-32000 Server errorto a list. Probed againstleantime.itkdev.dkwith the production key:status['1','2','3','4']— what we sent'3''1,2,3,4'So
implode(',', self::OPEN_STATUS_IDS), which keeps the existing meaning exactly.users.getAllanswers-32001 You are not allowed to perform this actionfor our API key. This sits on the same path —findOpenSecurityTickets()resolves an assignee name per ticket, so the page stayed broken on the status fix alone, as soon as one ticket matched.The directory now comes from the data-api plugin instead, which is already installed on that instance and serves
id, email, nameover the key we hold.loadUsers()pagesworkersuntil a short page arrives, comparing against the limit the plugin echoes rather than the one we sent — it caps at 1000 silently, and comparing to our own number would stop after the first page.Ticket creation stays on JSON-RPC: data-api is read-only by design.
Note the path is
/APIData/API/, case-sensitive. The plugin's own README documents/apidata/api/, which answers 404.Verified against the live instance
Running the patched service against
leantime.itkdev.dk:No exception — the page renders. Zero open tickets is the correct answer: the four the search returns are
Cybersikkerhedsopdatering august 2026,… 26Q3,… 25Q4and an unrelated OS2display agreement. Leantime'stermis a LIKE, soCyber+sikkerhedsopdateringmatches; the exact-headline check then rejects them, which is what it is for.Worth a separate decision
Those human-created tickets are named Cybersikkerhedsopdatering while this app creates and looks for
Sikkerhedsopdatering. If that is the name people actually use, the app will create duplicates next to them. Not changed here — it is a naming call, not a bug.Ticket assignment still needs the Leantime user permission, or
findUserIdByEmail()returns null and tickets are created unassigned — already handled, with a warning flash.Screenshot of the result
No user interface changes; the page renders its normal rows instead of the error flash.
Checklist