The Epic to child part is fairly simple.
The difficult part and one that I am struggling with currently is only copying certain fix versions from the Epic's Fix Version field.
Let's say Epic-1 has Fix Versions "ABC 2024" and "123 2024." I would like to copy only the "ABC 2024" Fix Version and not the "123 2024" Fix version.
Any ideas?
Do you have specific rules for exclusion? if so, you can iterate through the list of fixVersions and if they match the rules for exclusion then don't append in Epic else append it.
Let's say the rule is if the fix version doesn't contains ABC then don't append it and if it does then append it.
Is that enough of an exclusion rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Iterate over fixVersions
{{#issue.fixVersions}}
if(name.match("*(ABC)*"), <True do something>, <False do other logic>)
{{/}}
see if this works for you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the true and false sections, how would I copy that specific fixversion name if true and do nothing at all if false?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my proposed solution. see if this works for you.
As a trigger I have used Manul trigger. You can use as per your use case
1)
Create smart variable say varFilteredFixVersions. This creates a json object for matching fixVersions that need to be copied to child issue from epic.
{{#issue.fixVersions}}
{{#if(name.indexOf("ABC").eq(-1))}}
{"name": "{{name}}"},
{{/}}
{{/}}
2) Create a branch for Children
3) Then Edit issue select fixVersions to edit and in the advanced edit code box, put
{
"fields": {
"fixVersions": [ {{varFilteredFixVersions.substringBeforeLast(",")}} ]
}
}
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.
varFilteredFixVersions.substringBeforeLast(",") would have something like that.
So all the fixVersions in Epic and doesn't contain ABC, will be/should be added in child stories/task
if you need to reverse i.e. only copy where ABC is present then change eq to gt and that should work
{{#if(name.indexOf("ABC").gt(-1))}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reverse works well for my case, but right now it is still printing
{"name": "ABC fixversion"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you share the screenshot of the automation that you have?
and where it is breaking
so, if you have fixVersions like "ABC 2024", "123 2024", "2025 ABC" in the epic then ideally both "ABC 2024" and "2025 ABC" should get copied to child.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error I am currently getting is
Unable to find any issue field values to edit:
This is the JSON for settings fixversion
{
"add": {
"fixVersions": [
{"name": "{{varabcfixversion.substringBeforeLast(",")}}"}
]
}
}
And this is the code for the variable creation (varabcfixversion)
{{#issue.fixVersions}} {{#if(name.indexOf("ABC").gt(-1))}} {{name}}, {{/}} {{/}}
With an audit entry immediately after, I can print the correct fixversion
{{varabcfixversion.substringBeforeLast(",")}}
But I get the error I mentioned above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is the automation that I wrote. In the edit action, assumint you selected fixVersion field, i see the use of json in Additional fields may not be correct.
Can you try with what i have in screenshot i.e. additional fields text box should look like
{
"fields": {
"fixVersions": [ {{varFilteredFixVersions.substringBeforeLast(",")}} ]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vishal Biyani leaving the field blank like that clears the value. We can't have both the field and the advanced edit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No. it doesn't. Otherwise, there is no purpose of Advanced fields.
You need to select the field as far as i know. Otherwise, automation will give the error that you are seeing.
Try it out with one test issue that you may have and see how it goes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did, and it clears the value when I do that.
I am getting closer with this though, but it adds a space " " before the fixversion
Any ideas?
{
"fields": {
"fixVersions": [
{"name":
"{{varabcfixversion.substringBeforeLast(",")}}"
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not sure why a space will get added. How can you try using trim() to see if removes the leading and trailing spaces.
if this does not do the problem, check if there is an extra space added somewhere by mistake?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.