Sum Parent- Customfield with Customfields of subtask

Issue #315 resolved
Seher Sönmezsoy created an issue

How can I sum the custom field value of my subtasks to custom field of my parent task?

I used this expression for the transition 'done' with the post-function Mathematical or date-time expression calculator Function:

{50504}+sum(fieldValue({10502},subtasks()))

Best regards,

Seher

Comments (6)

  1. Fidel Castro Armario repo owner

    Hi Seher,

    Some questions:

    1. Do you want to add the value of a field in a subtask to the value of another field in parent issue at the moment when the subtask is being closed?
    2. Are the custom field in parent issue and the one if subtask the same custom field, or are they different custom fields?
  2. Seher Sönmezsoy reporter

    Hi,

    1. I want to implement a sum function 'provision'. I have a custom Field provision and a second custom field 'sum of provision'. If I change the transition from 'to do' to 'done', I want to have a calculate function to add the value of provision (subtask) to the sum of provision in my parent task.
    2. I create a custom field, but it doesn't inherit the value from parent task, so I think, they are different.

    I need this function for 2 different calculations: money and time.

  3. Fidel Castro Armario repo owner

    You should use "Mathematical and date-time expression calculator" post-function in transition "To Do - Done" in subtask's workflow using the following configuration:

    • Target field: "Parent's Sum of Provision"
    • Formula:
    sum(fieldValue({aaaaa}, filterByStatus(siblingSubtasks(), "Done"))) + {aaaaa}
    

    replacing aaaaa with field code of Provision custom field.

    Assuming that:

    • "Sum of Provision" and "Provision" are numeric custom fields.
    • "Sum of Provision" custom field in parent issue should always contain the sum of the fields "Provision" of all its subtask in status "Done".
  4. Seher Sönmezsoy reporter

    Thanks it works. How can I report the changing value of my provision in a dashboard? Is that possible?

  5. Fidel Castro Armario repo owner

    I'm not sure I have correctly understood your question, but I will try to answer: In dashboards you usually show statistics and information related with many issues, but you usually don't use dashboards for showing the value of a particular field of a particular issue.

  6. Log in to comment