Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jira Automation that performs action X days prior to version release

Mykhailo Pavliuk October 16, 2023

Hello!

I am working on an automation rule that should create a new issue in a project 5 days prior to version's release date.

I thought it should look like this:

-A scheduled rule that runs every day
-If  condition is met: it returns issues from this project, with a specific component, where difference between today and version release date is 5 days 
-It creates a Task with some pre-populated fields

The only problem here is that "Release date[Date]" = startOfDay(5) does not seem to work. 

I tried using condition that compares two custom values with this set up:

{{startOfDay.diff(issue.fixVersions.releaseDate.jiraDate}} = 5

But it fails to get requested value and also parses way too many issues.

Perhaps someone had a similar case?

Thank you!

4 answers

3 accepted

1 vote
Answer accepted
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.
October 16, 2023

Hi @Mykhailo Pavliuk 

Do you always have issues assigned to the next, unreleased version at that 5 day point?  The answer will impact how you solve this.

Yes, the team always has issues assigned...

No, the team does not always have issues assigned...

  • Try using a scheduled trigger, with no JQL
  • Using the Send Web Request action, call the REST API function to get all of the versions for the project
  • Filtering the web response for open versions, use list functions to get the earliest date, and perform the date comparison with a condition
  • And create the issue if the test passed

Kind regards,
Bill

Mykhailo Pavliuk October 17, 2023

hi Bill!

Both are great suggestions. So trick is that we always have issues assigned to fix version that is going to be released, but I have to make sure it is the right one by limiting the search by component, because the project is for mobile development and they have parallel versions for different OS. 

I will definitely use scheduled trigger and play around with Lookup to avoid parsing 1,000 issues.

Tim's suggestion to use double if conditions let's me grab it at exact date I need.

Thank you!

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.
October 17, 2023

If your Fix Version will ever have more than one entry, using conditions will not work as expected as it will return a list of dates.  In that case you may either add smart value, list filtering, or use the max function on the releaseDate in the list of versions.

Like Tim C likes this
1 vote
Answer accepted
Tim C
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.
October 16, 2023

Hi @Mykhailo Pavliuk

I think you're already quite close to a workable solution.

This condition works fine for me ...

Screenshot 2023-10-16 154028.png

You'll probably also have to add another similar one which is greater than 4 days - so that results found are only for those which are between 4 and 5 days away. 

If not, it will continue to find all previous release dates going backwards forever.

Screenshot 2023-10-16 154348.png

I hope this makes sense and is helpful?

Thanks,

TC.

Tim C
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.
October 16, 2023

Hi @Mykhailo Pavliuk 

I noticed you just voted for my answer ... please free to "accept" if this has worked - so it marks as answered (and helps others in community find this solution in the future). 

Also, it helps raise my profile (kudos points) 😀

Mykhailo Pavliuk October 16, 2023

Hi Tim!

Thank you so much for this correction, this condition passes without an error, but it doesn't match an issue that has FixVersion set to version that releases 5 days from now, non October 21st (also tried with 23rd in case it counts business days). 

I tested with both startOfDay and nowScreenshot 2023-10-16 at 18.06.16.png

Was this different for you?

Thanks!

Tim C
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.
October 16, 2023

@Mykhailo Pavliuk 

Yeah, it worked fine for me .... please check that the version is definitely set in the ADMSB project with associated release date and that version is assigned to the ADMSB-1 ticket?

Perhaps, use the "log action" event to record your smart values into the audit log to double check what's being found/compared....?

Screenshot 2023-10-16 161606.png

Mykhailo Pavliuk October 17, 2023

hi Tim,

Yeah the issue passes if it is less than now+6 and more than now +4 (because it is equal to now+5) so I just needed to sleep on this :) Thank you!

Tim C
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.
October 17, 2023

Hi @Mykhailo Pavliuk - that's great news. 

Glad to have helped.  Don't forget to accept my answer so gets marked as solved. 

Like Mykhailo Pavliuk likes this
0 votes
Answer accepted
Mykhailo Pavliuk October 17, 2023

for those finding this with the same problem, here is a full screenshot of the automation rule:

Screenshot 2023-10-17 at 15.39.26.png

0 votes
Mykhailo Pavliuk October 16, 2023

Current IF condition for the rule that fails:Screenshot 2023-10-16 at 13.07.16.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events