Is it possible to get precomputation by ID? According to docs no, is there a plan to make it possible?
Functions we have in mind depend on parameters, therefore we need to keep track of specific precomputations that need to be updated when an event, such as issue:update happens.
When, for example, issue status changes we will know that precomputation ID_A, ID_B, ID_C need to be updated. At this moment I don’t see a way to get specific precomputation, different than fetching all of them.
I could use storage to “cache” it, but that brings another problems with cleaning up resources, after they disappear
Hi @Floating-electron, thank you for reaching out!
Unfortunately, currently, it is not possible to fetch precomputations by id. The only option is to fetch all precomputations for the specific function.
However, when the function is evaluated, you can find a precomputationId
in the input object: https://developer.atlassian.com/cloud/jira/platform/jql-functions/#input
You can later use it, to update the precomputation (to update precomputation, you need a pair of precomputationId
and the value
). We intended to provide this id when the function is evaluated, so there won’t be a need to fetch precomputations later if you need only an id, to update it.
What specific data, besides an id, do you need from the precomputation record before you update it? I can’t promise anything now, but I will discuss it with my team if we could support fetching precomputations by id.
Best regards,
Łukasz
I’ve done some prototyping, and I am worried about supporting large amount of precomputations, especially when it comes to Forge limits. Fetching all, just to find one, doesn’t seem the right solution.
In order to evaluate and update a precomputation, I need a whole object you receive from API or at the first evaluation of the function, i.e. function parameters, clause, etc.
The only idea I have right now is to store a precomputationId and all related configuration (function parameters) in the Storage, but that basically means duplication of data that already sits there in the API.
Thank you for the feedback! I can see that it may be helpful to have an option to get precomputation by id.
We are gathering all ideas and potential issues and discussing them with the team. As I mentioned, I can’t promise anything at the moment, but I will get back to you as soon as I have some updates.
Best regards,
Łukasz
1 Like