A rule creating a new Sub-task when a Fix version is added to a Bug / Story (disregarding existing Fix versions in the Bug / Story), and the Sub-task should "inherit" the newly added Fix version.
If more than one Fix version is added a new Sub-task should be created for each one, and each one "inheriting" only one of the newly added Fix versions.
Trigger: Value changes for the Fix version field.
If: JQL: issuetype in (bug, story)
For each Smart value: {{#changelog.fixversions}}{{toString}}{{/}} or {{#fieldChange.to}}{{fixVersions}}{{/}}, with Variable name: newFixVersions
Then: Create new Sub-task with Fix version: {{newFixVersions}} (and copying a bunch of other fields)
As noted I've tried using fieldchange as well as changelong but none of them work, at least not the way I want it to.
This is what I tried first and it doesn't work at all: "The provided smart value couldn't be resolved to an object".
This surprised me a bit since I actually have another rule creating new Issues when Components are added to the Bugs / Stories (one Issue per Component added) which uses changelog exactly like this and it works like a charm. So I guess there's some under-the-hood difference between the Component and Fix version fields I'm not familiar with.
Not quite right. It does read the changed Fix version field but goes on to create Sub-tasks for all Fix versions, i e already existing ones as well as the newly added ones.
Any idea on how to solve this?
Short answer: what you are trying may not work because of known defects with the reliability of the Fix Versions field and the changelog available to automation rules. If you still want to try this...
Advanced Branches take a list as a source value, but the value you are supplying is a text string. You could try storing that with a Created Variable as a comma-separated values string, and then use split() to parse the variable into a list for the branch.
I recommend starting by creating the variable and just writing it to the log, with no branch to create the issues. After you have a changelog expression which works reliably-ish, then add the branch with the split() variable to create the issues, perhaps using either the version ID to directly set the field, or JSON with the version name in advanced edit.
Kind regards,
Bill
Can you try with {{issue.fixVersions.name}}?
To iterated through each version something like this is required
{{#issue.fixVersions}}
* Fix version: {{name}}, released on {{releaseDate}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.