I am trying to use Jira expressions for a more complicated scenario and discovered that when ‘manually’ loading an issue - using new Issue(id) - the custom properties [issue type fields] are considered expensive operations. As such, I cannot include more than 5 new Issue operations and for each a custom property access.
However, when loading issues using jql - from context - I am able to load several custom properties for each issue, even if the jql returns more than 50 issues.
Could you please let me know if this inconsistency is by design ?
I cannot load the issues using jql in this case. I have to find them using the custom property info.
First off, loading an issue with
new Issue(id) is an expensive operation on its own, so you will be able to load at most 10 in one expression. Add to that issue property access and you end up with a limit of 9 issues and 1 property, or 8 issues and 2 properties, and so on.
The way Jira expressions work under the hood is that some expensive operations are optimized when evaluated against a list. So while
new issue(id1).properties.prop ... new Issue(id2).properties.prop will have a cost of 4, if you put the issues on a list, and ask for the property for each item on the list, it will reduce the whole cost to 3:
[new Issue(id1), new Issue(id2)].map(i => i.properties.prop).
Hope this helps. Let me know if you have any more questions
Thank you very much for taking the time to confirm that this behavior is by design.
Unfortunately, I cannot provide the items in the list - I am working with an hierarchical structure. Anyway, discovering 5 items at a time and doing an additional request to get the properties is a little better than doing 5 requests.