Hi there,
I am trying to calculate number of linked issues by using variable with formula and it returns 2 as expected and also need to work with the last linked issue with max key. Here is my variable formula to count all linked issues (minus(1) is used as array starts with index = 0 so for 2 elements the last index will be count of 2 minus 1)
{{triggerissue.issuelinks.size.minus(1)}}
Then I try to retrieve the last element from the linked issues which will be the one with max key and getting the error during calculation. The hardcoded value works fine but the dynamically calculated one returns the error
1. This one returns me expected issue key when index is hardcoded as 1 - {{triggerissue.issuelinks.get(1).inwardIssue.key}}
2. These 2 variations give me error when index calculated dynamically - {{triggerissue.issuelinks.get({{triggerissue.issuelinks.size.minus(1)}}).inwardIssue.key}}
or
I found the right syntax for the last key.
Last element will be retrieved here
{{triggerissue.issuelinks.last.inwardIssue.key}}
the first element can retrieved as
{{triggerissue.issuelinks.first.inwardIssue.key}}
or
{{triggerissue.issuelinks.get(0).inwardIssue.key}}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.