Hello Atlassian Community,
I’ve been working with the JQL functions module and understand that it optimizes custom JQL function calls by evaluating them once and storing the results (precomputations) in the database. While this approach improves performance by avoiding repeated evaluations, I have a specific use case where I need the custom JQL function to run and return fresh results every time it is called, without relying on precomputed values.
Is it possible to create a JQL function that executes the custom logic on each call without using precomputation?
I would greatly appreciate any guidance or examples on how to achieve this, or if there are any alternative approaches to ensure the function is evaluated every time with up-to-date results.
Thank you in advance for your help!
Best regards,
Odin
Hi, @OdinSon. The subtaskOf Forge example shows how to use triggers to update precomputations when issues are updated or created.
If your JQL function relies on other data, then you’ll need to update your precomputations whenever that data changes. We have a case like this where we update our precomputations when org data changes.
It would be nice if the API let you invalidate a precomputation. That would be a more natural way to handle this. Adding the logic to update the precomputations at the right time can be a little tricky…
2 Likes
Hi @OdinSon, thank you for reaching out!
Unfortunately, it is not possible to disable precomputations for the JQL functions - precomputations are essential for the JQL function’s performance. While I understand there might be use cases like yours, we want to prioritize the end-user experience. With precomputations turned off, the user may experience a significant slowdown in JQL search (let’s imagine there are preconfigured filters using the JQL function, so the end-user doesn’t even know that the app is responsible for the slowdown).
As @RinoJose1 suggested, you can use the Precomputation API and update your precomputations in response to specific events. That way, the function should be able to always return up-to-date results.
Best regards,
Łukasz
4 Likes