Calculate field from sub-tasks
Issue #380
resolved
HI
Would you like to help me on this one please ?
In parent's issue, I have a number field 'remaining amount' For each issue I have several sub-task issues with another numeric field (sub-task amount)
I would to write this formular.
Remaining amount = remaining amount - (Sum of all (sub task amounts)
it is a great plugin thank you for your help.
Elvir
Comments (4)
-
repo owner -
reporter Thanks for your response.
So I would like to execute the post-function in the parent's workflow. Initial amount is a good idea too.
-
repo owner Then you should use "Mathematical and date-time expression calculator" post-function with the following configuration:
- Target field: Remaining Amount
- Formula:
{aaaaa} - sum(fieldValue({bbbbb}, subtasks()))
replacing aaaaa with field code for "Initial Amount", and bbbbb with field code for "Sub-Task Amount".
-
reporter - changed status to resolved
works perfectly. Thank you have a nice day
- Log in to comment
Hi Elvir,
It can be done using "Mathematical and date-time expression calculator" post-function.
The configuration to be used depends of whether the post-function is going to be executed by a transition in parent's workflow or subtask's workflow.
Anyway, I recommend you not to set the value of "Remaining Amount" custom field based on a formula that also uses the current value of "Remaining Amount", since it will make the value dependable of the number of times the post-function is executed.
It's a much better solution to have a field called "Initial Amount" (or something like this), and set the value of "Remaining Amount" with a formula like:
Remaining Amount = Initial Amount - (Sum of all (Sub-Task Amounts))
Please, let me know: