Hello all!
I'm struggling with a jira automation on a business board.
The issue fields concerned:
* Due date
* Start date (as far as I can see, it was created by a jira admin)
* Length (I've tried a number and text field)
Goal: when an issue is updated, start and due dates are both not empty, then calculate the business days between them and insert them into the new field "Length". Format of output is irrelevant (eg 5, 5.0, 5 days) - everything goes.
Smart value I have tried:
{{issue.duedate.diff(issue.startdate).businessDays}}
Also with issue field IDs and calculation {{#=}} & {{/}}
Hello @patricia.ambichler
Welcome to the Atlassian community.
Whenever asking for help with an Automation rule, it will help us help you if you provide screen images showing the complete rule and the details of each step.
In the case where the rule is not doing what you expect it will also help us if you provide all the details from the rule Audit Log for a time when the rule executed, and if you tell us what you expected the specific result to be and what the actual result was.
Lastly, when using smart values the field names you use in them are case sensitive and space sensitive. If "Due date" and "Start date" are the field names you see in the screen, then try using
{{issue.Due date.diff(issue.Start date).businessDays}}
Hello @Trudy Claspill , thank you so much!
I've tried various versions of the smart value, including "Due date" and the IDs.
I don't know how much the audit log will help, as it says "success" but the issue field Length never changes.
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.
Text or number should be fine for the Length field.
A debugging technique that is available to you is to use the Log action to print into the rule Audit Log the values of the smart values you are trying to use. That will help you determine if the right information is being obtained from the issue.
If you can do that and run the rule again, and provide the requested screen images, and an image of the issue against which the rule ran showing the Due date and Start date fields, we will be better able to help you diagnose the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's a helpful tip, thanks! & the result is very interesting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But what do you get when you add the Log actions to your own rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "right" answer, just with a negative - (still with a manual trigger)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be helpful if you put those Log actions into your actual rule and execute the action that triggers your rule to run. Then show us both your complete automation rule and the output in the Audit Log from the rule execution.
If you aren't getting the expected result in your actual rule, we need to see that information to debug the reason.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To achieve no (-) in the Length field, I swapped the start and due dates in the smart value
The log, completed rule,and ticket below. It's interesting because the log now shows (-) but the ticket field is correct. Not sure what exactly is happening with the result, but happy with it.
Thank you so much for your help @Trudy Claspill !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the abs function to have the final result be a positive number regardless of how you arrange the date fields in the statement. There an example of that in the documentation about the date difference function.
If my answer thread has helped you solve your requirement please consider clicking on the Accept Answer button to mark your post as Solved.
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.