I'm having trouble getting size to count to zero when there is nothing in a list.
Through some other funky use of smart values, I have built a variable (one per squad using the same syntax) that holds the sprints for each ticket delivered by a squad for a specific Epic. The string held in teamSprintsTESTamps looks like this:
Amps Sprint 7@Amps Sprint 7@Amps Sprint 5@Amps Sprint 6@Amps Sprint 7@Amps Sprint 6@Amps Sprint 6@Amps Sprint 5@Amps Sprint 7@Amps Sprint 6@Amps Sprint 7@Amps Sprint 5@Amps Sprint 4@Amps Sprint 7@
Using the following, the result given is "Amps: 4" (correct)
Amps: {{teamSprintsTESTamps.substringBeforeLast("@).split(@).distinct.size|0}}For another team that only had one task in the Epic that they delivered in one sprint, the string held in teamSprintsTESTheat looks like this:
Heat Sprint 7@
And the result returned is "Heat: 1", which is also correct:
However for the teams that did not contribute to the specific epic, the result returned by .size is 1 (incorrect).
For the team that were not part of the delivery of Epic X, the following code:
Bigbus: {{teamSprintsTESTbigbus.substringBeforeLast("@).split(@).distinct.size|0}}
A. #{{teamSprintsTESTbigbus}}#
B. {{teamSprintsTESTbigbus.substringBeforeLast("@)}}
C. {{teamSprintsTESTbigbus.substringBeforeLast("@).split(@)}}
D. {{teamSprintsTESTbigbus.substringBeforeLast("@).split(@).distinct}}
E. {{teamSprintsTESTbigbus.substringBeforeLast("@).split(@).distinct.size}}Returns the following output (to prove to you there's no value in that variable:
Bigbus: 1
A. ##
B.
C.
D.
E. 1
Is there a way to get the correct result of 4 for Amps and get the correct result of 0 for Bigbus?
*Squad names have been changed to protect the innocent