I'm encountering issues with implementing automation using ScriptRunner in Jira to calculate the end date based on custom estimations and to update epic estimations based on child issues. Below are the details and the scripts I have tried:
(Dev Estimations + QA Estimations + Tech Art Estimations) / 7
, rounded up.Attempted Approach without ScriptRunner (Using Jira Automation):
Any help to resolve these issues or to identify where the scripts might be failing would be greatly appreciated!
Thank you!
Hi @Maggie Tokarzewska -- Welcome to the Atlassian Community!
First thing, I am not currently using ScriptRunner and so my suggestions will focus on your Jira Automation rule shown.
You note there are challenges with your solutions, but you do not describe what they are. What is not working as you expect with your rule?
Until we know those challenges...some observations for your rule are:
The {{#=}} ... {{/}} syntax is a math operation, and it is not used for date incrementing. To increment a date value, just use the plus / minus functions, such as:
{{issue.myDateField.plusDays(someValue)}}
When someValue is a variable, that needs to be converted to a number for use in the functions:
{{issue.myDateField.plusDays(someValue.asNumber)}}
I have observed using fields to be problematic in rule smart values. Instead I recommend using either the exact smart value for the field, or its custom field id. To correctly identify those, please use this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
The basic steps are:
yourJiraURL/rest/api/2/issue/yourExampleIssueKey?expand=names
The rule adjustments for weekends may not work as you expect, as they only account for the end point falling on a weekend day and not any multiple weeks that could be spanned by the estimates.
An alternative approach is to explicitly increment by business days instead:
{{issue.Start date.plusBusinessDays(totalWorkingDays.asNumber)}}
Even with this approach, this will not handle any non-working holidays. Those will need either a much more complex rule or another solution approach.
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.