I'm trying to get the number of days between the issue created date and a custom date field called closed date (also tried the system issue.resolutiondate but that didn't work either). No matter what the dates are set to in the issue, the automation rule will only return 1 in the target field. All of the examples in the documentation for date functions list comparing to (now), but I want to compare it to another date field. How do?
Hi Jamie
To get diff between two dates fields I used something like this:
{{issue.customfield_10015.diff(issue.customfield_10016).minutes}}
In my case I want to had diff in minutes but you can easily switch this to days.
Helpful docs:
- date attributes - https://docs.automationforjira.com/working-with-issue-data/date-functions.html#attributes-of-a-date
- calculate the difference between two dates - https://docs.automationforjira.com/working-with-issue-data/date-functions.html#calculating-the-difference-between-two-dates
Let me know if this help you :)
Regards,
Sebastian
Thank you Sebastian! My syntax was off, that was the problem (as usual).
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.
Hi @Assia Touati You can add it wherever you want (comment body, field value). In my case I added it as a value of text field.
You must remember that field type must me correct with result type (e.g. if you want put something in number field diff result should be a number).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so the difference between two timedate in hours should be put in a number field ? am i right ? @Sebastian KrzewiĆski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It can be put in text field. It depends what you need do next with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sebastian KrzewiĆski ,
Thanks in advance.
I have one scenario where I have start date and end date and want to populate the difference in field duration which is number field.
Can you please help me in configuring this.
I tried populating result in description field but not getting anything there.
Regards,
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @abhishek.singh
Please check - https://support.atlassian.com/jira-software-cloud/docs/smart-values-date-and-time-functions/
In your case I will probably use {{[date1].diff([date2]).[unit]}} smart value.
You should use this value in proper field in action edit issue.
Regards,
Sebastian
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.
Hello!
i want something like this
{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
but getting a email every 24 hours, with the NEW comments of the day (24hours)
get only new comments, with the code i sent to you, i receive all comments
something like {{#issue.comments}}
IF {{created}} = 21/04/2021 14:00
Comment by: {{author.displayName}} at: {{created}}
{{body}}
{{/}}
basically if created in last 24 hours, appear on my mail
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.