Worklog | Including last time spent in a task in the epic parent
Asked by Jorge:

Hello there,

I am creating a new rule through**Automation for Jira plugging** (in **Data Center** instance) trying to **add up the time spent in a task** *(time that is being registered in this moment)* **in the epic parent also.**

---ATTACHED IMAGE---------------

Example:

Epic Time Spent before the new worklog= 1d

New worklog is logged to one of its tasks = 2d

New Epic Time Spend should be = 3d

------------------

++However the++ ++following rule add up all accumulated worklog on the task to the epic.++

Thank you all in advance,

Best regards![Jira issue.png](https://community.atlassian.com/t5/image/serverpage/image-id/340243i027B5F57EF906662/image-size/large?v=v2&px=999 "Jira issue.png")


Answers:
author: Bill Sheboy
body: Hi [@Jorge](/t5/user/viewprofilepage/user-id/5217895)

When the trigger is Work Logged *for the child issue* and you also want to log that same work *to the Epic parent*, use this smart value and not the issue's worklog with the Log Work action:

```
{{worklog.timeSpentSeconds}}
```

Kind regards,  
Bill

comments: author: Jorge
body: Thans for your comments, [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

You are right.

I have used the following smart value with the Log Work action and finally epic logs the correct value (not the accumulated)

```
{{worklog.timeSpentSeconds}}
```

Now the point is, how could I change the Actor? Because this is being registered by Jira Administrator user (owner and actor of the rule). I cannot change it to **"User who triggered the event".**

**Remember that it works in Data Center**


author: Bill Sheboy
body: I do not believe it is possible to log work on behalf of another person, and I recall there are open suggestions to add that feature.


author: Jorge
body: Thank you [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313),

Imagine a scenario where you want to log time that belongs to other day. According to my rule, it is always being logged at {{now}}.

?Do you know if it is possible to set the same date that was set in the Story?

![Jiraerror.png](https://community.atlassian.com/t5/image/serverpage/image-id/340734i18029E7B8A3778B7/image-size/large?v=v2&px=999 "Jiraerror.png")


author: Bill Sheboy
body: To use the same value from the trigger, please enter the value {{worklog.started}} in the Date Started field when you log the work.


author: Jorge
body: [@Samuel Kolloch](/t5/user/viewprofilepage/user-id/5319810)

+ [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)

+ [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

+ [@YY Brother](/t5/user/viewprofilepage/user-id/4083879)

comments: author: YY Brother
body: ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/340261iEC2674DEBB7AF2F2/image-size/large?v=v2&px=999 "image.png")

Have you considered what if I delete a worklog on a task?


author: Jorge
body: Hello [@YY Brother](/t5/user/viewprofilepage/user-id/4083879) , thanks for you time

If I delete the historical worklog for the task and I load time for the first time I get the expected result.

But for the second register I get the accumulated sum of the task.

*** ** * ** ***


Tags: automation

data-center

jira-data-center

time

time-spent

time-tracking

worklog