Hi Community,
Hoping to get some answers as always.
I am trying to create a rule that should create an issue 2 business days prior to second business day of the month.
where I have set vartestDate to 2024-11-29 for testing.
VarmyDate is set to the smartvalue: {{vartestDate.toDate.plusmonths(1).firstBusinessDayOfMonth.plusBusinessdays(1)}}
varFinalDate is {{varMyDate.minusBusinessDays(2)}}
I am not able to find out y the condition is not being met. Can anyone help with the issue?
You comparison in the condition is based on 2 variables right?
The the clause should be:
{{vartestDate}} equals {{varFinalDate}}
This as both values are stored in a variable.
Yes, and...to Marc's suggestions:
When using rule conditions to compare dates / times, I recommend using a known and defined format, such as jiraDate: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---
You could add date formatting to the smart values in the condition to ensure the behavior is what you expect.
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.
@Marc - Devoteam - I tried it but did not work. Also to have same format as of varTestdate, i tried comparing {{vartestdate}} equals{{varfinaldate.jiradate}}.
vartestdate = 2024-11-29
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you check that the spelling is correct, correct captals used, 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.
Please post images of the condition, and your current complete rule.
As Marc notes, the smart values are case-sensitive, and the values you posted do not seem to match the rule's Create Variable actions in the rule image.
The correct ones would likely be:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This suggestion worked Bill but now the issue is that the condition is getting satisfied everyday. It should have created the subtask only on Nov 29'24 but it was success and created issues on Nov 30,Dec1 and Dec2 as well. Please find the screenshots of all variables and conditions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Smart values (including functions) are name, spacing, and case-sensitive.
There are several errors in your Create Variable action for varmyDate and other steps, and so I suspect the rule is comparing null and null in the condition. That could be checked with audit log writes for the variables and by reviewing the date / time documentation: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Let's look at the details...
First, {{now}} is a date /time type, and thus is not followed by the function toDate. That happens in several places in your rule. Only when converting the variables to a date should that function be used in your rule.
The variable varmyDate value could be this, with corrections to the capitalizations:
{{now.plusMonths(1).firstBusinessDayOfMonth.plusBusinessDays(1).jiraDate}}
And varFinalDate could be this:
{{varmyDate.toDate.minusBusinessDays(2).jiraDate}}
I also recommend walking through scenarios like this by hand to confirm they do what you expect. So as an example, if you ran the rule today (and it was still today in UTC)...
varmyDate = 2024-12-02 + 1 Month -> to first Business Day + 1 Business Day
= 2025-01-02 -> to first Business Day + 1 Business Day
= 2025-01-01 + 1 Business Day
= 2025-01-02
Note that Jira does not recognize 1 Jan 2025 is a holiday in some locations, and so that is the first business day of the month. "BusinessDays (business days are considered to be Monday to Friday, 9am to 6pm)"
varFinalDate = varmyDate - 2 Business Days
= 2025-01-02 - 2 Business Days
= 2024-12-31
Again, Jira does not recognize 31 Dec 2024 is a holiday in some locations. If these are acceptable dates for your scenario, please disregard this information.
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.