Reset logwork in postfunction

Issue #459 resolved
Samuele Pretini created an issue

Hi Fidel,

I’ve a question for you about managing of tree of issues.

When I fire the stop status on son issue, I want to reset the log work on father issue and than log on father all work log of the son’s.

For the sum of work log of the son’s I’ve read your answer here: https://groups.google.com/forum/#!msg/jira-workflow-toolbox-plugin/TlS3PZfhSP0/n2fZ7vokAGUJ

But for reset the work logged on father, I can use the post function : Update Time Spent, ad set it to zero? Or I have to do other action? The Time Spent field is equal to log work field?

The Structure plugin seems to report the older value of log work, also I reset the Time Spent. Why?

My needs is because, the users in certain situation make a mistake to log work on soon’s and so (they have logged 1w….bad mistake) and than they adjust the work logged, but the father must report the new correct value of logged work, and so I can’t only sum value on father, but in certain situation I have to overwrite the logged work on father. So I’ve decided, for simplicity, to reset every time the logged work on father first to calculate the sum of son’s logged work.

Thanks for your answer.

Comments (4)

  1. Samuele Pretini reporter

    Fidel answer to me: Try using "Mathematical and date-time expression calculator" post-function in transition to Stop status in subtasks worklow (son issues) with the following configuration: Formula is:

    sum(fieldValue({00025}, siblingSubtasks())) + {00025}

    Note that {00025} is field code for "Total time spent (minutes)".

    In the proposed solution field Total time spent (minutes) in parent issue is overwritten each time, so it's not necessay to reset it,

    Please, tell me whether this solution works as you expect. Captura de pantalla 2016-12-10 a las 23.29.49.png

  2. Samuele Pretini reporter

    I have a question: 1. The father issue has no subtask...but linked issues with "is father of" criteria. Your solution is already valid ? 2. After apply your solution I have to log work on Parent issue? I have to log work on son issue?

    Thanks

  3. Fidel Castro Armario repo owner

    Hi Samuele,

    I was assuming that the relation was parent-subtask. After your clarification I change the formula with this one:

    sum(fieldValue({00025}, linkedIssues("is son of", linkedIssues("is father of"))))
    

    I'm assuming that the issue link type is read "is son of" from son's side.

    With this solution you should log the work only on son issues, since parent's work logs will be overwritten with the sum of work logs on the son issues.

  4. Log in to comment