We have an automation that creates a ticket every weekday. I would like to add a condition to the automation that causes it to skip specific days i.e. tickets are not created for holidays such as Christmas (25/12) or New Year's Day (01/01).
Have tried using smart values but did not manage. Is this possible to do and if so, how can we go about doing this?
Thanks in advanced.
Hey @Nadege
Dates can be tricky.... here's my recommendations. I'd go with option 2 personally!
Option 1: IF/ELSE in Automation rule with hard-coded dates
try using the condition in your automation of "IF/ELSE" (no need to use the else as you can add all the dates into the conditions of the first IF).
I would configure it like this (for each date):
A screenshot showing this is below:
Option 2: Visual through using multiple projects
Option 2 allows for some good flexibility by using a proxy project to act as a calendar... it's a funky way but hear me out. Benefits of this is you can easily add or remove dates, AND someone else can manage them without touching your automation!
See screenshot of flow below:
You can check if today's date matches a specific list of dates using various methods. In Python, you can use the `datetime` module to get today's date and compare it against a predefined list of dates. First, import the module and define your list of dates in a consistent format, such as `YYYY-MM-DD`. Then, get today's date using `datetime.today().strftime('%Y-%m-%d')`, and check if this date exists in your list using a simple if statement. If today's date is in the list, you can print a message indicating a match; otherwise, print that there is no match. This approach can be easily adapted for other programming languages or tools like Google Sheets or JavaScript, using their respective date handling and comparison functions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nadege
As @Jovin mentioned, the first option is the best one IMHO. And thanks @Jovin I didn't know you could use this value {{now.year}}-12-25 like that.
If you want to know more about smart values for dates check here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gotta love the smart values @Aaron Pavez _ServiceRocket_ ! Can get super creative with them!
The first one is definitely easier to understand, but I do quite like using projects for "visual auditing"... I do the same thing for bulk API calls etc. 😅
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.