So I have a large project with some teams working in Fix Versions and some in Sprints. It's not best practice but I've been asked, to smooth teams filling out too many fields when entering tasks to automate filling in fix versions when an issue is added to or makes changes to a sprint.
Trigger:
When: Value changes for Sprint
Conditions:
Sprint is not empty
Other conditions
Create Variable: varLastSprint {{issue.sprint.last.name}}
So I can get the name of the sprint which is last in the order fine (maybe some edge cases with this in the long run if things have multiple sprints assigned if the sprint has closed, but can probably sort these later)
The Fix Versions are named in this format "AB N" - e.g. "AB 1"
The sprint name format is "AB N Sprint N" - e.g. "AB 1 Sprint 2"
My current strategy is to grab varLastSprint smart value and somehow strip up to the space before the sprint x to just leave me with the "xx 1". A couple of hours of playing around with smart values has got me to here:
{{varLastSprint.split(" ")[0]}} {{varLastSprint.split(" ")[1]}}
However I don't think this is working and is erroring when I'm testing it.
Any strategies and suggestions would be most welcome.
Thanks