When closing a [task] transaction (Change Request for example) no new Metric record is created. This is by script and expected. However the 'End' and 'Business duration' fields of the last Metric record for that transaction are NOT getting updated.
Out Of Box, there a special Metric MTRC0000007 which closes out (ends) other Metric records when an the active flag of an the Incident turns 'false'.
Create a Metric Definition (navigation: Metrics > Definitions) based on MTRC0000007 to work with the [task] transaction(s) you are interested in (Change Request for example).
Also, make sure that the order for that Metric does not conflict with Business Rules such as the 'mark_closed' one. The Metric must run after the transaction active flag has been set to 'false'.