Hello,
I have a Jira Software Team Managed project, which is essentially used for tracking the team's tasks. I have automation rules set up whereby recurring tasks will be created based on a specific occurrence. For example, I have set a rule whereby on every 3rd Thursday of the month, a task will be created - Confirm TEC attendance and a Slack message will be sent to the team. The due date for this task will be on every 4th Thursday of the month.
The task creation and Slack message is successful, it works. But the Due date field is empty. I have tried below smart values in the Due date field:
{{now.startOfMonth.plusDays(21).withDayOfWeek(4)}}
{{now.startOfMonth.plusWeeks(3).withDayOfWeek(4)}}
{{now.plusWeeks(3).format("yyyy-MM-dd")}}
{{now.plusWeeks(3).withDayOfWeek(4)}}
I have also tried removing the Due date field and use the additional fields instead using this (same smart values variations as above for Due date field smart values):
{ "fields": { "dueDate": "{{now.startOfMonth.plusDays(21).withDayOfWeek(4).format('yyyy-MM-dd')}}" } }
{ "fields": { "dueDate": "
{{now.startOfMonth.nextThursday.plusWeeks(3).format('yyyy-MM-dd')}}" } }
But all methods result in the Due date field being empty.
Could anyone help to advise on this, please? I appreciate your help. Thank you.
Attached are the screenshots of my rule set up.
There looks to be a case issue. Can you try with fieldname as
duedate
Also, if this does not work share the audit log to better understand the issue
Hello @Vishal Biyani thank you for the suggestion. I have changed from dueDate to duedate, but the issue persists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it is not working withdayOfWeek.
You can try with {{now.startOfMonth.plusWeeks(3)}}. this returns the date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Vishal Biyani thank you again for the suggestion. I managed to make it work. I think what I did was complicated, when it can be done in a simple way. For the benefit of others who are experiencing the same thing as me, here was what I did.
I added the Due date field and used this smart value: {{now.plusDays(7)}}
As this rule is triggered on every 3rd Thursday of the month and the due date is every 4th Thursday of the month, so essentially I just need to set the due date 7 days after the due date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nur Fatin
I see you solved your question by simplifying the expression; well done!
For future reference, please note the reason your JSON failed is including single rather than double-quotation marks. When you want to use functions such as format() within a rule's JSON, add the asJsonString function at the end to add the surrounding double quotation marks.
For example:
{
"fields": {
"duedate": {{now.plusDays(7).format("yyyy-MM-dd").asJsonString}}
}
}
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.
When using withdayOfWeek like this {{now.withdayOfWeek(4)}}, it didn't return any value.
Can you suggest how to use this correctly?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That function, and its related ones, do not appear to be working for Jira Cloud as inline functions, and I did not find a defect in the public backlog for this symptom (although there is an older one for Jira Server automation).
My tests (with various parameters and capitalization patterns) only return null values. For example:
{{now.withDayOfWeek(1)}}
{{now.withDayOfWeekName("Monday")}}
{{now.withDayOfWeekShortName("MON")}}
The long-format version of the first one works, even with a variable:
{{#now}}func=withDayOfWeek(1), format="yyyy-MM-dd"{{/}}
The other long-format ones did not work.
I recommend submitting a defect to Atlassian Support. I will do so through the feedback mechanism, although I cannot do so through support on a Free license.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for response. I learnt a new way (func=...) to use formulas in automation.
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.