Hi All,
I’m trying to set a help text on the Original Estimate field dynamically using Behaviours. The goal is to show a message when the entered value in Original Estimate exceeds a certain threshold.
However, unlike other fields (like number or text fields), the Original Estimate field doesn't behave as expected. When the value changes, the help text doesn't update in real-time. It only appears after the issue is updated and reopened — not immediately as the value is entered.
This means the dynamic behavior isn’t working as it does with standard custom fields, which respond to changes instantly.
Can someone help me understand why Behaviours don’t work dynamically with the "Original Estimate" field?
Please suggest any other possible solution as per the requirement..
Below is my code:
1. Attached this below script to "Original Estimate" Field in behaviours
//Code Start
// get Original Estimate field object
def originalEstimateField = getFieldById(getFieldChanged())
def value = originalEstimateField.getValue()
def loggedTimespent = underlyingIssue.timeSpent
log.info("Time Spent (in seconds): " + loggedTimespent)
def numValue = 0L
if (value) {
try {
numValue = Double.parseDouble(value.toString())
} catch (Exception e) {
log.warn("Invalid value format: " + value)
}
} else if (underlyingIssue?.getOriginalEstimate()) {
numValue = underlyingIssue.getOriginalEstimate()
}
log.info("Original Estimate in seconds: " + numValue)
// Convert original estimate to days
def estimatedDays = numValue / 28800
log.info("Estimated Days: " + estimatedDays)
// Convert time spent to days
def timeSpentDays = loggedTimespent ? (loggedTimespent / 28800) : 0
log.info("Time Spent in Days: " + timeSpentDays)
def valueche = estimatedDays - timeSpentDays
log.info(valueche)
if (estimatedDays > 5) {
originalEstimateField.setHelpText("Original estimate exceeds 5 days. Please review.")
} else {
originalEstimateField.setHelpText(null)
}
//Code Ends