I have a few custom fields where I have to update the total sum of the subtasks estimates as per some defined percentage. I have used the following formula:
{{#=}} floor({{issue.subtasks.Original estimate.sum.divide(3600).multiply(0.20)}} / 40) + "w " + floor({{issue.subtasks.Original estimate.sum.divide(3600).multiply(0.20)}} % 40 / 8) + "d " + ({{issue.subtasks.Original estimate.sum.divide(3600).multiply(0.20)}} % 40 % 8) + "h" {{/}}
I am getting this error:
Unable to parse expression floor(10 / 40) + "w " + floor(10 % 40 / 8) + "d " + (10 % 40 % 8) + "h" : floor(10 / 40) + "w " + floor(10 % 40 / 8) + "d " + (10 % 40 % 8) + "h"
I have also tried using the following:
{{#=}} totalQaHours = {{issue.subtasks.Original estimate.sum.divide(3600).multiply(0.20)}}; weeks = floor(totalQaHours / 40); remainingQaHoursAfterWeeks = totalQaHours % 40; days = floor(remainingQaHoursAfterWeeks / 8); remainingQaHours = remainingQaHoursAfterWeeks % 8; weeks + "w " + days + "d " + remainingQaHours + "h" {{/}}
For this, I am getting the following error:
Unknown operator ; at character position 18: totalPmHours = 14; weeks = floor(totalPmHours / 40); remainingPmHoursAfterWeeks = totalPmHours % 40; days = floor(remainingPmHoursAfterWeeks / 8); remainingPmHours = remainingPmHoursAfterWeeks % 8; weeks + "w " + days + "d " + remainingPmHours + "h"
And then for the final total value, I have used the following expression:
{{#=}} qaTotalHours = {{issue.QA Estimation.split("w").first.trim}} * 40 + {{issue.QA Estimation.split("w").last.split("d").first.trim}} * 8 + {{issue.QA Estimation.split("d").last.split("h").first.trim}}; saTotalHours = {{issue.SA Estimation.split("w").first.trim}} * 40 + {{issue.SA Estimation.split("w").last.split("d").first.trim}} * 8 + {{issue.SA Estimation.split("d").last.split("h").first.trim}}; pmTotalHours = {{issue.PM Estimation.split("w").first.trim}} * 40 + {{issue.PM Estimation.split("w").last.split("d").first.trim}} * 8 + {{issue.PM Estimation.split("d").last.split("h").first.trim}}; totalHours = qaTotalHours + saTotalHours + pmTotalHours; weeks = floor(totalHours / 40); remainingHoursAfterWeeks = totalHours - (weeks * 40); days = floor(remainingHoursAfterWeeks / 8); remainingHours = remainingHoursAfterWeeks - (days * 8); weeks + "w " + days + "d " + remainingHours + "h" {{/}}
Can you please suggest to me here, How I can fix this issue?