Searching for a ticket number does not yield the ticket
Desktop (please complete the following information):
- OS: MacOS Ventura
- Terminal: Kitty
- Architecture: x86
- Fjira version: 0.11.0
Describe the bug Searching for only the numbers of a ticket id, does not show me the ticket.
E.g.:
To Reproduce
- Open a project in the app.
- Start typing in the numbers of a ticket id
- See nothing :smile:
Expected behavior
Same as putting in the whole ticket id:
@jneidel I will have a look, thanks for such a great testing ❤️
I know what's the reason here. I've introduced some debounce in order to not trigger jira search query with every key event. When you press "backspace" the results should be refreshed, - there is no debounce for "backspace".
okay / I found a reason. The fix is almost ready.
the problem is a bit more tricky. So there is a mechanism already that fjira is asking Jira API about new search results if query looks like jira ticket number. JQL goes like this: issuekey=?. Unfortunately there is nothing like issuekey contains in Jira Api.
It will require big change in fjira fuzzy finding mechansm, -but it's possible. In current implementation it's a mix-up of jira search api, and fuzzy finding. Jira issues are re-fetched from Jira Api in some concrete cases. The only way I see to make : issuekey contains part of the key' would be to pre-fetch all of the Jira issues for the project, cache them - and then monitor, and keep cache in sync.
It's possible change, and I need to say that I like it - but it also has some cons. The main question her would be .. is it really have some benefit to search via "part of the issue key"?
does it really have some benefit to search via "part of the issue key"?
When using whole issue keys I never type them out, I only use them via copy-paste.
In my project we reference issues via the number. So if a colleague in a meeting references issue 9912, then I don't want to spell out the always-the-same prefix. Especially when it's about quick access. (Which is where this app shines.)
My current workflow for that has been:
- go to browser
- go to any jira page
- change the ticket number
@jneidel I have the similar workflow. I'm using fjira like this:
fjira ABC-9912
it's opening the issue view right away.
I'm investigating the solution mentioned by me in the previous comment. I like it, but it could be challenging.
The solution might goes like this: fjira can scrap the whole project in the background - similar to what fzf is doing when you run it from the top of your filesystem - the results are dynamically added to the list. Then fuzzy finding could be done on the whole collection, and searching via part of the key will be possible.
The potential problem is Jira Api speed. I did some tests, and it takes ~600-1000ms to fetch 100 records. I checked Jira Cloud Api. It could take 10-20 seconds to fetch 2000 records. Pretty slow..
I found a suggestion here https://community.atlassian.com/t5/Jira-questions/How-to-filter-using-JIRA-ticket-numbers/qaq-p/1422090 they said that jql like this:
project = ABC and key >= 'ABC-01' should be possible. I will give it a try
Hi mk-5,
fjira ABC-9912
This fits fine for my workflow :+1: