Hi everyone,
Hopefully an easy one here. I want be able to calculate, in Jira Automation, the duration (in business days) between two dates.
I've used:
Duration would = {{issue.Start date.diff(issue.duedate.plusDays(1)).businessDays}}d
This works great if that start and due dates are more than a day apart, but not if they are the same date, it returns null.
I think I may have the wrong syntax/position for the .plusDays(1).
Any help greatly appreciated.
Cheers,
JonC
After some examination of documentation, looks like you need to experiment with if conditions, they can help in your case.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Take a look at isEquals() method.
Hi @Evgenii
Thanks for the speedy response. I must be missing something here as I'm not getting anything back from the formula.
I've enter it as:
But get back:
Am I missing something here?
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this. Checked it, it's working. First variant was completely wrong.
{{#if (equals(issue.Start date.jiraDate, issue.duedate.jiraDate))}}
0d
{{/}}
{{#if (not(equals(issue.Start date.jiraDate, issue.duedate.jiraDate)))}}
{{issue.Start date.diff(issue.duedate.plusDays(1)).businessDays}}d
{{/}}
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.