Hello! I am trying to add fix versions to the parent/epic from the trigger issue. My trigger is when the fix version value changes on a story/bug/task. I have a branch to check that a parent exists and then to modify the parent using the JSON below:
{"update": {"fixVersions" : [{"add": {"name":"{{triggerIssue.fixVersions.name}}"}}]}}
I have referenced many other articles and resources such as https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/ but I think somewhere I am missing a step. My audit log sjhows that its hitting an error when it tries to edit the parent: (Specify a valid value for fixVersions (fixVersions)).
Hello @Toni Duer
Is your Parent epic in the same project as trigger issue?
It is in the same project.
Hello,
If your trigger issue has more than 1 fixVersion, then we have to format the JSON..
Before Branch,
Create a variable, call it myvar assign it {{#issue.fixVersions}}{{name}}{{^last}},{{/}}{{/}} [see screenshot]
Then in your advanced edit, use below smart value:
{ "update": { "fixVersions": [ {{#myvar.split(",")}}{ "add": {"name" : "{{.}}" }}{{^last}}, {{/}}{{/}} ] } }
Basically, above syntax will render the JSON like below:
Thanks! I added the new variable. Do I need to reference the new variable in my JSON later when I edit issue fields or will that stay the same?
Hi @Toni Duer and @Kalyan Sattaluri
Please note the {{fromString}} and {{toString}} values for the changelog of Fix Versions could overlap in values, and...
There could be inconsistencies due to this known defect for changelog accuracy of list fields such as Fix Versions and Sprints: https://jira.atlassian.com/browse/JRACLOUD-80486 This defect is worsened as apparently not all of the UX paths to change / create Fix Versions are tracked in the changelog.
At this time, there is no known work-around for this defect. The severity and priority were recently increased, so perhaps this will be finally fixed.
For a mitigation, you may try:
Kind regards,Bill
Oh wow. Thanks @Bill Sheboy Went and checked and {{changelog.Fix Version.toString}} is definately broken and {{changelog.Fix Version.fromString}} "seems" to be working but I havent checked thoroughly. Thank you and will be mindful go forward.
@Apologies@Toni Duer given this news, may have to rethink if you want to handle removes or just sync child stories to parents.. Cause blanket syncing which you have already/first implemented should be working. Just this nuanced pick and choose part seems to be broken from Jira..
@Bill Sheboy @Kalyan Sattaluri Good to know! Thanks for the update.
It looks like you're new here. Sign in or register to get started.