I am trying to calculate the difference between Start Date and End Date and automatically fill in a custom field for time estimation purposes.
I have this automation working:
{{issue.start date.diff(issue.end date.plusDays(1)).prettyPrint}}
which will print out:
6 days
And I also have this automation working:
{{issue.start date.diff(issue.end date.plusDays(1)).businessDays}}
which will print out
5.0
I've tried:
{{issue.start date.diff(issue.end date.plusDays(1)).prettyPrint.toBusinessDays()}}
{{issue.start date.diff(issue.end date.plusDays(1)).toBusinessDays().prettyPrint}}
{{issue.start date.diff(issue.end date.plusDays(1)).businessDays.prettyPrint}}
Is it possible to have business days but output as pretty print?
Hi @Lauren Yoder -- Welcome to the Atlassian Community!
I suspect the answer is "no" for automation rules.
Both businessDays and prettyPrint are output modifiers for the diff() function. And the output of businessDays is always whole integer days: https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html
So, what would "prettyPrint" even look like when those are chained in that context? There is no unit of measure (I believe) for "business weeks", "business months", etc.
For your example, what would you expect to display for prettyPrint when the source is 6 business days? If you can explain that, perhaps you could use math and conditional operators to produce your result.
Kind regards,
Bill
Thank you! I ended up just using business days and appending "d" to the end of it so that the estimate field would accept it as days.
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.