Hi everyone,
I'm trying to generate a list using jira automatons of all the fix versions scheduled or have released in the current month.
Currently I'm using this below for now. Sadly it's producing duplicates as it's running on each issue.
Note: We have an older version of automatons on our instance, no lookup.
Is there a better way or a way to fix the duplicate issue I'm getting?
Thanks!
Hello again!
So we finally moved to our new data centre and are now on version v9.12.7.
All the options you have given work so thank you for the help on these!
Quick question:
What would be the best way to put each value onto a new line or in a table format?
Tying to create a report like this within an email.
I tried to generate a simple list but this keeps returning blank.
{{#issue.fixVersions}}name: {{name}}{{^last}}, {{/}}{ {/}}
I also tried this, but I only get the last version in my query.
Any ideas?
Hi @Hunter1428
As a reminder, I am using Jira Cloud, and not Data Center version, so please test any suggestions to confirm they work.
Just to confirm is this for a single issue as you are showing a prefix of {{issue... for the expressions?
First, try writing just the field to the log and observe what you get:
#1) just the version ids: {{issue.fixVersions}}
That should list the version ids as a CSV list. If that works, try this one:
#2) just the version names: {{issue.fixVersions.name}}
If that works, try this one to iterate the values:
#3) version names iterated over: {{#issue.fixVersions.name}}{{.}}{{^last}}, {{/}}{{/}}
If it works, try adding your formatting.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill, thank you for the swift response!
My filter looks over many issues which are spread across multiple fix versions. Can confirm 4 fix versions are spread over the issues the filter finds.
I tried all the suggestions you said and here is the outcome.
If I change issue to issues. I get the full list. But its just one long string which I'm unable to format into bullet points. Maybe I'm just dumb and expecting the "list" stuff to outcome something different then what it actually does.
Here is my automation layout just encase it's an issue with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rule trigger you show has selected the bulk handling option, and so the smart value is the {{issues}} one used, and not {{issue}} and so I wonder if there is something different for that list of values (similar to the current Data Center limitations with Lookup Issues).
Again, I am using Cloud not Data Center, and so cannot check this...
Please try writing this to the log and test the rule:
List of counts: {{#issues}}{{key}}:{{fixVersions.size|0}}, {{/}}
That should produce a list of the keys and the number of fix versions in each issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
This does indeed produce a list you mention.
But I think I'm beginning to confuse you here in what I want haha.
Let me clean up and clarify what I'm looking for.
I'm looking to generate a report every month to show a list of all the versions we have released within the month and send it via email automatically.
Something like this.
I can do the HTML and CSS part but I'm struggling to get the data correct and in the right format.
So far this is very close to what I want. But I'm getting duplicated fix versions and I cannot format the date. I tried using distinct on the fixVersions but no affect and I also tried to use .format("d/MMM/yy")}} for the start and release date. But also no affect.
<table>
<tr>
<th>Version</th>
<th>Start Date</th>
<th>Release Date</th>
</tr>
{{#issues.fixVersions}}
<tr>
<td>{{name}}</td>
<td>{{startDate}}</td>
<td>{{releaseDate}}</td>
</tr>
{{/issues.fixVersions}}
</table>
Apologies on confusion and thanks again for all the help so far!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Jira Cloud, the one way I know how to do this is: merge the versions to a known delimited-format, split / distinct, and parse with match().
For example:
{{#issues.fixVersions}} name:{{name}};startDate:{{startDate.jiraDate}};releaseDate:{{releaseDate.jiraDate}}~~{{/}}
{{varAllFixVersions.split("~~").distinct}}
{{#varAllFixVersions.split("~~").distinct}}
<tr>
<td>{{match("name:(.*);startDate:.*")}}</td>
<td>{{match(".*;startDate:(.*);releaseDate:.*")}}</td>
<td>{{match(".*;releaseDate:(.*)")}}</td>
</tr>
{{/}}
That last bit uses an interesting feature of iterators where unnamed list elements are normally referred to as {{.}} but that can be implied with the use of functions directly.
Please adjust accordingly to get your desired formatting and delimiters...subject to the names of your fix versions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Urghhh absolute magician @Bill Sheboy
I began going down the variable route also but the Match() stuff I would spent ages trying to understand. This provided a lot of useful info I can apply in other areas of things I'm working on.
Thank you so much for the help and have a great weekend!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Hunter1428
Please try {{issues.fixVersions.name.distinct}}
BTW - Make sure you have below checkbox selected on your scheduled trigger page..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for assisting!
I tried what you suggested but unfortunately this produces.
I also tried both below but they produced a blank output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please log below 2 smart values in the below order (as shown below) and share similar screenshot which shows your audit log.
Also, make sure you have checked the box as mentioned in my original post.
BTW - The other smart values you have listed are not correct syntax so blank is expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I copied yours to see if it was some issue with the branch. But still have the same issue.
Double checked and check box "trigger in bulk" is indeed checked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am stumped, LOL.
Could you log {{issues.fixVersions.id.distinct}} instead just to try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here haha.
Sadly still the same issue.
I wonder if it's a bug in an older version of jira automation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Hunter1428 and @Kalyan Sattaluri
FYI, I am using Jira Cloud, not Data Center, and so cannot test what I suggest. With that out of the way...
Too bad your instance does not have the automation version with Lookup Issues, as perhaps there is some differences in behavior with bulk-handling and the {{issues}} smart value.
I would expect {{issues.fixVersions.distinct}} to contain arrays, possibly with repeats of the same version. The reason why is if any issues were ever in multiple releases (e.g, A, B, C) then that set would be treated as a distinct value rather than each release.
Have you tried flattening the results out first, perhaps like this:
{{issues.fixVersions.name.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
That would join everything, removing any array handling, and then split back into a list before the distinct attempt. Please note, I may have some missing spaces for the array removal, so try logging that and making adjustments, as needed.
Kind regards,
Bill
UPDATE: I tweaked it a bit after testing :^)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just strange. I would guess that .distinct would work..
You could make a REST API call to get the version list of your project and find versions with release date in current month... but its a lot of work..
1 last one, does {{issues.reporter.distinct}} work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Thanks for also assisting!
Unfortunately both suggestions result in emptiness.
I'm going to have a chat with some of our IT guys to see if we can get some updates. As building a REST API call just for this is like said a lot of work. It seems we just have an old version which either contains bugs or does not have these things fully implemented.
If i managed to get an update I will try again and report back!
Any other ideas come to mind please throw them over and I will indeed give them a try.
Thanks for the help regardless :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try my updated expression, as I found a mistake in the one you are showing which uses replace() rather than remove() for the array brackets...and removes extra spaces resulting from the join()?
{{issues.fixVersions.name.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
Did you also see the suggestion from @Kalyan Sattaluri to confirm the bulk-handling option is selected for the trigger? Otherwise the {{issues}} smart value will be empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe you should check with your internal Jira Admin team on the version you guys are currently on..
Cause I spent some time digging into DC edition release notes and found this blurb in July's 2023 release notes:
I would have expected more documentation on what that means but no such luck.
My guess is, maybe you guys have an Automation version which is older than 8.2.2 and so this .distinct operation is not working.
You should def advocate to upgrade to latest, the latest edition has lookupIssues and create variables which are very useful otherwise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy Yup "bulk-handling option is selected for the trigger" is 100% ticked. Your updated expression also produced a blank output.
@Kalyan Sattaluri Our instances is running on 7.7.2. I assume this is the problem. Thanks for taking a dig into documentation!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.