Automation with condition for specific weekday fails

Melanie Rusch
Contributor
November 4, 2024

Good Morning,

I have two issues in jira cloud:

  • VKU-83 with the custom cascading field info "Wöchentlich" (weekly) and "Montag" (Monday).
  • VKU-80 with the custom cascading field info "Wöchentlich" (weekly) and "Dienstag" (Tuesday)

My automation runs every day at 5:00 AM. It should check each day, which day it is. And if the Day and the cascading Info for the day matches, it should clone the issue.

But everything I tried failed. The audit log says the condition don't match.

Can someone please help me fix the automation?

As far as I can understand the problem is the condition "{{now.format(fullDate)}} contains Mon". I tried with "Monday", "Mon", "Montag". Also "Tuesday", "Dienstag". I thought it should work because of this schedule an automation rule only on weekdays

But obviously not.

I am very thankful for your help!

 

Here some screenshots:

Automation2.jpgAutomation1.jpg

2 answers

1 accepted

2 votes
Answer accepted
Tobias H
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.
November 4, 2024

Hello @Melanie Rusch 

For full date you want it to be {{now.fullDate}}

Format() is used when you want to specify the format like YY/MM/DD or mm/dd/YYYY 

You can read more about the date smart values here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Day-of-month---

Hopefully that is all you need to change for it to work!

Melanie Rusch
Contributor
November 4, 2024

Oh my... you are my hero. THANK YOU!

Like Tobias H likes this
1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2024

Hello @Melanie Rusch 

Looking at the timestamp for the rule's execution:

Screenshot 2024-11-04 at 11.14.48 PM.png

...the rule is executing on 5 November. The day of week for that date is Tuesday. Therefore the condition that checks if the full date contains "Mon" is correctly failing. and the Else block is correctly executing.

When setting the date and time of execution in the Schedule trigger you can select the timezone. What have you selected?

When looking at Date/Time fields in Jira, the data is stored in the database in UTC, regardless of which timezone you have set as your timezone in your profile. The UTC information is converted for each person's view according to the timezone they have set in their profile. Due to that, when you get the value for a Date/Time field it will be expressed in UTC unless you use the convertToTimeZone() function to convert it to your preferred timezone.

So, you need to consider the timezone you have set in the Scheduled trigger and ensure that any date/time value you are evaluating are converted to the same timezone.

Melanie Rusch
Contributor
November 5, 2024

Good Morning @Trudy Claspill 

Thank you for your response!

There are two If-Else-Conditions, one for Monday and one for Tuesday. The Screenshot could have been better.

The Answer from Tobias helped and now the automation works perfectly fine :) 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events