To get the time spent and remaining estimate field ids and and current values:
def timeSpentField = getFieldById("timespent") // or getFieldById(TIME_SPENT)
def mIssue = underlyingIssue as MutableIssue
def timeSpent = mIssue.getTimeSpent()
def remainingEstimateField = getFieldById("timeestimate") // or getFieldById(TIME_ESTIMATE)
def remainingEstimate = mIssue.getEstimate()
To update the time spent field on the form:
timeSpentField.setFormValue(remainingEstimate)
The new value for time spent does not appear on the screen on which I have placed the work log field.
I am able to update another field, which I tried as a test:
getFieldById(DESCRIPTION).setFormValue("Would like to set the time spent field to ${timeSpent}.")
I suspect that I am not getting the field object for the "timespent" field since I am unable to update it on the screen via setFormValue.
I would appreciate some help getting this to work.
Thanks!