Hello community!
The problem I am trying to solve is to store a list of values in a created variable, and then access one of the values with a function inside of an iterator. Has anyone done this?
For example:
- Created variable named varList contains a list, such as dates: 2021-12-24, 2021-12-31, 2022-01-15
- Iterator attempts to split and then use the values from the list. To only list the values, use {{.}}
{{#varList.split(",")}}{{.}}{{/}}- But to use the list value in a function, the {{.}} cannot be used:
{{#varList.split(",")}}{#if(issue.created.diff(.).days.gte(0))}}+1{{/}}{{/}}- I wonder if there is another smart value which represents {{.}} that can be used
{{#varList.split(",")}}{#if(issue.created.diff(WHAT_TO_PUT_HERE).days.gte(0))}}+1{{/}}{{/}}- Other things I tried which did not help:
- Nest the list split() to use the same list inside the iterator, accessed by get(index). This evaluates to null, leading to the conclusion: a list cannot be accessed inside its own iterator, or that index loses meaning as a function parameter.
- Copy the created variable list to another variable, and then try the nested list technique with one list insider of another's iterator. This evaluates to null.
- Format the list in the created variable as JSON, use the encode function, and then attempt to access the list by attribute name. This evaluates to null.
The thing I cannot figure out is how to access the list iterator value. I wonder:
- Is there an internal smart value name for {{.}} that can be referenced; or
- Can a created variable be structured as an object with attribute names (like "value"), and then split for later reference/use; or
- This not possible.
The only work-around I have found is to store the values in an entity property instead of the created variable.
Thanks for your ideas!