---
title: "Forcing Users to Log Time During a Transition"
canonical: "https://support.appfire.com/space/SUPPORT/80878158/Forcing%20Users%20to%20Log%20Time%20During%20a%20Transition"
format: markdown
---
If you have ever tried the [Require User to Log Work Before Transitioning Issue](https://appfire.atlassian.net/wiki/spaces/TR/pages/18286026) tutorial, you will see how to force a user to log time if they have never logged time to an issue. But what if you want users to log time before EVERY transition? If you would like to know how, read on!

## Background

Using Live Fields, we can force users to enter time based on what they enter in the "Time Spent" field no matter what. This method builds on the [Validating Custom Fields](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/80878096) page. The code found in the "Validating a Custom Field in the Edit Screen" section is very similar.  


**Main Script**

|  |
| --- |
| ```
lfInstantHook("timeSpent", "LiveFields/hook.sil");
lfWatch("timeSpent", "timeSpent", "LiveFields/hook.sil");
``` |

**Hook Script**

|  |
| --- |
| ```
if (argv["timeSpent"] == "") {
    lfShowFieldMessage("timeSpent", "Hours logged cannot be empty", "ERROR");
    lfDisable("transitionSubmit");
} else {
    lfHideFieldMessage("timeSpent");
    lfEnable("transitionSubmit");
}
``` |


Here is what the validator looks like in action:

![image](media://5d665cdb-9c2f-4328-bac9-30dda16436c7)


## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on this page. 

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |