Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
AKR Absent Member.
Absent Member.
596 views

Defects - How to make the latest comments show up on the top instead of on the bottom.

If I want to make sure that all my latest comments under the defects module show up in the descending order of date, how can that be made possible. Essentially, I would like to do an insert in the beginning rather than append the additional comments to the end of the comment section. How can this be achieved.
0 Likes
8 Replies
Vladimir Skrbek Acclaimed Contributor.
Acclaimed Contributor.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Very common question.
For example see this forum article:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1215173

and also see my note about it. Use diffrent aproach to comment because the HPQC comments is not good. It is jsut free memo field and when you do the comments you do not want to see and edit other comments.
0 Likes
AKR Absent Member.
Absent Member.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Hi Vladimir,
thanks for your reply. I am looking at actually inserting the latest comments to the beginning of the comments field and not appending it to the end of the comments field as it usually happens when i hit the add comments button. In this way, I believe the latest comments can always be on the top. I do not want to create a new field etc., as the user wants to see all the comments. I can either recode it in such a way that when i click on add comment, it does not add the comment at the end. Instead it will put it at the beginning of the comment field. The forum you referred to makes the add comment field mandatory etc., which is not what i want. thanks.
0 Likes
Vladimir Skrbek Acclaimed Contributor.
Acclaimed Contributor.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Hi as I said I do not use this comments process because it is just the memo field and when you want the commnet work fine you have to write a lot of workflow code. I think if you want to use this field and process and button from HPQC you has to create and insure this missing functions (as a lot of users wants to do it):
- user can add comments only after clicking the button
- this button will add the customized heading to the comment like username, datetime, project name and so on
- you want this added comment has to be in the top of the Memo field not in the end
- you want the cursor will be in the top of the comment but after the added heading
- you want to control by workflow script when the comment will be mandatory and when not

Some of it can be done by workflow script very easyly and some of them not. Therefore I use my process that is much beter to customize and controlled. And user see the all comment history and cannot chagne it.

If you want it still then you should lookup the old mercury KB and have a look on this articles:
http://support.openview.hp.com/selfsolve/document/KM184200?searchIdentifier=741ad1db%3a119eae19a77%3a-5ce2&resultType=document&documentURL=KM184200&resultsURL=%2fselfsolve%2fdocuments&allowReturn=true
http://support.openview.hp.com/selfsolve/document/KM291229?searchIdentifier=741ad1db%3a119eae19a77%3a-5ce2&resultType=document&documentURL=KM291229&resultsURL=%2fselfsolve%2fdocuments&allowReturn=true
http://support.openview.hp.com/selfsolve/document/KM289709?searchIdentifier=741ad1db%3a119eae19a77%3a-5ce2&resultType=document&documentURL=KM289709&resultsURL=%2fselfsolve%2fdocuments&allowReturn=true
http://support.openview.hp.com/selfsolve/document/KM295970?searchIdentifier=741ad1db%3a119eae19a77%3a-5ce2&resultType=document&documentURL=KM295970&resultsURL=%2fselfsolve%2fdocuments&allowReturn=true

also seart the tdforums.tdadmins.com and have a look to this article:
http://tdforums.tdadmins.com/index.php?showtopic=4917

As Eric said and I told here. You have two posibility. "... Prevent editing of the existing comments and keep using one field or use two fields where one is readonly and historical and the other is an entry field?... "

Other articles in TDForums:
http://tdforums.tdadmins.com/index.php?showtopic=4587
http://tdforums.tdadmins.com/index.php?showtopic=4473
Something about HTML tags:
http://tdforums.tdadmins.com/index.php?showtopic=4594

For the getting to the top you should try use the function "WshShell.SendKeys" as is stated in some articles.

Good luck
0 Likes
sheetaldeshpand Absent Member.
Absent Member.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Hi There,

Please try this code.


if ActionName = "BugAddDevCommentsAction1" then

'Actions.Action("BugAddDevCommentsAction1").Visible=false
's=Bug_Fields("BG_DEV_COMMENTS"). Value
Defects_ActionCanExecute=false
' Bug_Fields("BG_DEV_COMMENTS"). Value = Bug_Fields("BG_DEV_COMMENTS"). Value & "
admin " & FormatDateTime(Date(),1) & " " & _
' "


-------------------------------------"
' Bug_Fields("BG_DEV_COMMENTS"). Value = Bug_Fields("BG_DEV_COMMENTS"). Value & "
" & Bug_Fields("BG_RESPONSIBLE"). Value & ">"& " " & FormatDateTime(Date(),1) & " " & _
' "
---------------------------------------------------------------"

'Bug_Fields("BG_DEV_COMMENTS"). Value = Bug_Fields ("BG_DEV_COMMENTS"). Value & "
_________________________________________________________" & _
' "
" & user.FullName & " " &"<" & user.UserName & ">" & " " & FormatDateTime(Date(),1) &"
"
Bug_Fields("BG_DEV_COMMENTS"). Value ="
_________________________________________________________" & _
"
" & user.FullName & " " &"<" & user.UserName & ">" & " " & FormatDateTime(Date(),1) & "
" & "

" & Bug_Fields ("BG_DEV_COMMENTS"). Value & ""

end if
Thanks/Regards,
Sheetal
0 Likes
AKR Absent Member.
Absent Member.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Hello Sheetal,
Can you please let me know if the comments in the code are deliberate or do i need to remove the comments and aad the full code. Also, would this help me in obtaining the order of comments for older defects too.
thanks
0 Likes
Absent Member.. Beth L Absent Member..
Absent Member..

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

Has anyone been able to get this to work? I have tried several versions of the code posted, but am not able to get it working.
0 Likes
Highlighted
AKR Absent Member.
Absent Member.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.

I badly need something to fix the issue, but there seems to be no simpler solution.
0 Likes
Suleena Sharma Absent Member.
Absent Member.

Re: Defects - How to make the latest comments show up on the top instead of on the bottom.


Hi I just tried this . The code works when you add comment for a bug that has not yet been opened.
When i open the bug this code does not work .
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.