First, I want to create an issue automatically with a schedule trigger every 2 business days prior to last business day of the month.
Second, to create an issue on 2 business days prior to first business day of month.
I have thought and tried a lot but no idea how to go about it. Smart values like {{LW.minusbusinessdays(2)}} or any other smart values are throwing error in cron expression. I believe it is not allowed there.
Any assistance would be of great help. Thanks.
Hi @Abhilasha Tyagi and welcome to the community!
There is no explicit way to capture this as a cron that I'm aware of. However, you could go this route:
This will execute daily and check to see if the current run time is 2 business days before the end of the month. If the condition passes, create the issue, otherwise exit.
Thanks for your response. now.startOfDay.endOfMonth - what does this return? Is this same as last business day of the month?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So what should be happening is that it's validating whether the execution start of day matches the start of day for 2 business days before the end of month.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings!
Adding to Mark's suggestions, please review the documentation for the automation date / time functions to understand their behavior:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
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.
@ Mark, Since I am interested in 2 business days prior to last business day of month besides 2 days before last day of month, can I edit the condition parameter as
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is what it looks like ..do you think this will work.Asking for validation coz there is no way I can test it until this EOM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can test almost anything in rules immediately, as follows:
When I test for several cases in scenarios like this, I create a list of dates, and iterate over them to test:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Really appreciate your help, Bill.
The test run is working as expected for 1 case only. When {{now}} is replaced by another variable with value 2024-10-29 the issue got created. However it is not giving desired results with date variable set to 2024-11-27 (i.e issue should have been created as 27th Nov is 2 days before last working day (29) in Nov.
What is going wrong now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post an image of your complete test rule, the action where the date change is happening, and the audit log details showing the rule execution. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
here when date is date in October, issue gets created correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But when variable date is set in November, the if condition does not pass and issue is not created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Isn't the last business day (i.e. Monday-Friday) of November 2025 the 28th, not the 27th? And so your test day should be the 26th.
Rather than create issues in testing, I recommend using the list method I described and just writing both dates to the audit log. That will reduce cleanup after testing.
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.
Your test dates shown in the create variable images are both for 2025. Please change them and re-test.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.