I've created an automation which creates a ticket on the 1st of each month. The ticket needs to be populated with a due date which is the 2nd Friday of that month.
I've not been able to identify how to do this by looking at the existing documentation and questions. Please can someone help?
You can set due date as {{now.ofTheMonth(2,5)}}
the 5th day of the 2nd week of the Month. Hope this is helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kara Nadarajah I believe you have a scheduled trigger that creates an issue on the first day of every month. To the action that creates the issue, you need to set the value for the due date field. You need to choose the due date field from the options. Under the Due Date field, click on pick a date and set the value. Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, you can set there date manually but in that case you would have to change it every month, there is no exact smart value to calculate 2nd friday 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.
Thanks, I know how to set the due date but there is no option and no smart value in the documentation for setting '2nd Friday of each month'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kara Nadarajah Can you try something like
{{#=}}
startOfMonth().plusDays(
14 - startOfMonth().dayOfWeek().plus(1) % 7
)
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, i'd be grateful if you could explain what that formula is doing as I don't understand it and would be apprehensive to blindly apply it in case it doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The formula uses startOfMonth()
that gives the first day of the current month. The dayOfWeek()
gives the day of the week as a number (eg: Monday = 1, Sunday = 7). Then ,the formula calculates the offset needed to reach the first Friday, then adds 7 days to reach the second Friday.
I recommend that you test this thoroughly before you implement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Currently what you are trying to achieve may be impossible and you would have to set the date manually, but maybe you can think of something with the idea,
Scheduled automation that would run once a week on Friday and check if today's date is between 8 - 14 day of the month (using smart value) and do some action at that moment.
Though if someone needs to fill that out within that time I think setting up some custom SLA with reminders for that specific person or group would be a better solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kara Nadarajah I believe this smartvalue will be answer for you
{{#if(equals(now.dayOfWeek==5))}}
{{now.plusDays(7).format("dd/MM/yyyy")}}
{{/}}
{{#if(not(now.dayOfWeek==5))}}
{{now.withNextDayOfWeek("FRI").plusDays(7).format("dd/MM/yyyy")}}
{{/}}
Smartvalue searches for the next friday, adds 7 days and prints the date in following format. First part is for when rule would be run at Friday then just add 7 days to that date, second part is for whenever the day when automation is run is not friday, then it would find the next friday, add 7 days to it.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.