element(list, index) returns the element at position index in list. The index wraps around: if index is greater than the list length, it cycles back to the beginning.
Signature
Example
Assign each build to one of several artifact storage buckets in a round-robin fashion using the build number:artifacts-a, build 1 to artifacts-b, build 3 back to artifacts-a, and so on.
Notes
indexwraps using modulo arithmetic, so it never produces an out-of-bounds error.- To get the last element without knowing the length, use
element(list, length(list) - 1).