Hello,
i need to write an automation for an internal control system that opens control tickets with different frequencies. For this purpose, it reads the stored frequency from a customfield of a control datasheet ticket. The options are daily, weekly, monthly, etc.. Now I have to open a control activity issue, which contains, depending on the frequency, the day, the week, the quarter or the information whether one is in the 1st or 2nd half of the year in the ticket summary. Unfortunately, it seems there is no easy way to get the half-year. Therefore I used if else functions, which compare {{now}} with the date 01.07 and if the date is before 01.07 1st half year is used and starting from the 01.07 the 2nd half year. Currently I use: {{now.compareTo(now.withMonth(7).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withMillis(0))}}
Is there possibly an easier way here? Except to build own automations for both half year options, which run on 01.01 or 01.12.
Hi @systems-intern ,
for deeper understanding and analyze please consider to also provide further information in the form of screenshots of eg. issues, current automation rule,...
From what you wrote at the end (the compare date regard 1st or 2nd half of the year):
would the following solve that in an easier fashion:
{{[date1].isBefore([date2])}}
see also:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--
or did i get something wrong?
Best
Stefan
You can get the number of month by doing something like:
{{now.monthOfYear}}
So you can do something like
{{#if(now.monthOfYear.gt(6))}} Second half of year {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
correction of the last sentence: i meant 01.01 and 01.07 :)
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.