When adding an R&D comment to a defect, it would be beneficial to have the system also add a timestamp to the comments added. There is a documented HP KB article that provides a script that will add a timestamp, but it does not retain the original function (bolded blue text, line seperating each comment, etc.) This one does. Code provided with no warranties...
' BEGIN CODE
Function ActionCanExecute(ActionName)
On Error Resume Next
ActionCanExecute = DefaultRes
If ActionName=''AddDevComment'' or ActionName=''BugAddDevCommentsAction1'' then
dim DescriptionBefore
dim ServerTime
dim UserStr
DescriptionBefore = Bug_Fields(''BG_DEV_COMMENTS'').Value
if Len(DescriptionBefore) = 0 then
DescriptionBefore = ''<html><body>''
else
DescriptionBefore = DescriptionBefore + ''<br><strong><font color=#000084>________________________________________<br></font></strong>''
end if
UserStr = User.FullName + '' <'' + User.UserName + ''> ''
ServerTime = CStr(TDConnection.ServerTime)
'Start R&D comments
DescriptionBefore = DescriptionBefore + ''<strong><font color=#000084>''
DescriptionBefore = DescriptionBefore + UserStr + '', ''
DescriptionBefore = DescriptionBefore + ''''+ServerTime+''''
DescriptionBefore = DescriptionBefore + ''</font></strong>'' + '': <font color=#000000>'' + ''<br>''
'End R&D Comments
DescriptionBefore = DescriptionBefore + ''</font></body></html>''
Bug_Fields(''BG_DEV_COMMENTS'').Value = DescriptionBefore
ActionCanExecute = False
End If
On Error GoTo 0
End Function
' END CODE