Automatically Generate List of Fix Versions for the Current Month

Hunter1428 February 21, 2024

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.

  • JQL: fixVersion in releaseDate("after startOfMonth() before startOfMonth(1)")

Currently I'm using this below for now. Sadly it's producing duplicates as it's running on each issue.

  • {{#issues.fixVersions}} {{name}} {{/}}

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!

1 answer

0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

Hello @Hunter1428 

Please try {{issues.fixVersions.name.distinct}}

BTW - Make sure you have below checkbox selected on your scheduled trigger page.. image.png

Hunter1428 February 21, 2024

Hi @Kalyan Sattaluri

Thanks for assisting!

I tried what you suggested but unfortunately this produces.

  • [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []


I also tried both below but they produced a blank output.

  • {{#issues.fixVersions.distinct}} {{name}} {{/}}
  • {{#issues.fixVersions}} {{name.distinct}} {{/}}

 

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

Please log below 2 smart values in the below order (as shown below) and share similar screenshot which shows your audit log.

  • {{issues.fixVersions.name.distinct}}
  • {{issues.fixVersions}}

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.

 

 

Hunter1428 February 21, 2024

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.

image1.png

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

 I am stumped, LOL.

Could you log {{issues.fixVersions.id.distinct}} instead just to try.

Hunter1428 February 21, 2024

Same here haha.

Sadly still the same issue.
image2.JPG

I wonder if it's a bug in an older version of jira automation?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

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 :^)

 

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

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?

 

Hunter1428 February 21, 2024

Hi @Bill Sheboy

Thanks for also assisting!

Unfortunately both suggestions result in emptiness.

image3.JPG

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 :)

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

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.

Like Kalyan Sattaluri likes this
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2024

@Hunter1428 

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:

https://confluence.atlassian.com/automation/jira-automation-release-notes-1018767858.html#:~:text=Added%20the%C2%A0smart%20value%C2%A0list.distinct%C2%A0to%20CollectionWrapper

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.

 

Like # people like this
Hunter1428 February 22, 2024

@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!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer