# Groovy script for automatically logging hours in JIRA

**URL:** <https://community.developer.atlassian.com/t/groovy-script-for-automatically-logging-hours-in-jira/55594>\
**Category:** Jira Server\
**Tags:** time-tracking, scriptrunner\
**Created:** [February 2, 2022, 3:54pm UTC](https://community.developer.atlassian.com/t/groovy-script-for-automatically-logging-hours-in-jira/55594 "2022-02-02T15:54:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivana1](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Ivana1](https://community.developer.atlassian.com/u/Ivana1)\
**Post date:** [February 2, 2022, 3:54pm UTC](https://community.developer.atlassian.com/t/groovy-script-for-automatically-logging-hours-in-jira/55594/1 "2022-02-02T15:54:44Z")

</div>

Hello everyone,  
We have written a script in Script Runner that automatically log hours for users. The script works okey (log hours for different users) but  
we have found a bug where the Logged field gets only the last log hours, not all, like shown in the picture bellow.

 ![image_2022_02_02T15_41_16_043Z](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/9/b/9b8193f4f3a7cd6447bd5e1d569c13c1daf250d8.png)

Can someone have an idea how this can be done?
