Make original estimate required on sub-tasks

Guy LaRochelle May 6, 2019

Hello

I create a behaviour associated with the "Original Estimate" field. I mark the field as being "Required" and this works, I see a little red asterix beside the field on the sub-task creation form.

However, the following script does not work and when I leave the field empty, I can still create the sub-task, no error at all.

def originalEstimateField = getFieldById("timetracking_originalestimate")
def originalEstimateValue = originalEstimateField.getValue() as long

if (originalEstimateValue != null){
originalEstimateField.clearError()
}else{
originalEstimateField.setError("All sub-task require an original estimate.")
originalEstimateField.setFormValue(null)
}

I also tried this instead for the condition:

if (originalEstimateValue > 0){

 Please help!

1 answer

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2022

Hi @Guy LaRochelle 

What are you trying to achieve here? I'm a bit confused about the error message you wrote.

Are you trying to make original estimate field for a subtask mandatory? If yes, when? During creation? Through out the subtask's lifecycle? Only during a specific transition?

Why does the error message states something about "all subtasks"? 

Suggest an answer

Log in or Sign up to answer