Issue: I am at a company that is not in a position to purchase plugins (with additional security/auditing considerations on freeware) and I have a need to shorten the time to record short work tasks after they have happened.
Approach: I wanted to use a Post Function script on a specific task type to:
This allows my users to fill out the minimal amount of data for no complex tasks (admin ankle biters) with the issue title and how long it took, and then save and have it be done. This script would in essence take the Estimated time and record it as time spent. Reason for accessing the work log is that we are utilizing time sheets for some analysis and unless I append this time to the work log, time is not recorded.
I have been able to successfully create a custom task type and custom workflow and was able to update the timespend field with the estimated time and close... but I cant figure out an easy way to interact with he work log.
(not to get long winded) I looked at several Post Functions and 'Copy Issue Fields Post Function' comes the closest...only issue is the 'Fields to copy' field has the worklog field but the 'Destination field' does not have this as an option. I also looked at the Set Field Value Post Function but it also does not have a worklog selector. I WAS able to use this last feature to update the time spent, but as I said, the time was not represented in the time card.
Copying the Estimated time to the Worklog is a pretty unique requirement so I don't think any of the standard workflow post functions are likely to work. If you are on-prem and have ScriptRunner you could probably do this with a custom scripted post function.