Results 1 to 5 of 5
  1. #1

    Need QC script for \"Add Comment\" mandatory

    I Need Quality Center script to pop up 'Enter Comments' message box whenever defect is modified and quits without adding any comments. I would like to make comments is mandatory for each modifications/updation for the defects.
    I really appreciate your help


  2. #2
    Moderator swt88's Avatar
    Join Date
    May 2003

    Re: Need QC script for \"Add Comment\" mandatory

    Why a popup - just make the field required (i.e. it shows in red) in the module field settings.

  3. #3
    Advanced Member
    Join Date
    Aug 2004
    Wellington, New Zealand

    Re: Need QC script for \"Add Comment\" mandatory

    Vishwa is asking for a new comment to be mandatory any time a change is made to the record. Making a field mandatory just means it can't be empty. Once one comment has been added, there will be no further prompts.

    The _CanPost function will only execute if changes have been made to the record, therefore we just need to check here if the BG_DEV_COMMENTS field has also been changed:

    On Error Resume Next

    Defects_Bug_CanPost = Project_DefaultRes
    ' The fact that this function has been called means that the record has been changed!
    ' has a new comment been added?
    If Field("BG_DEV_COMMENTS").IsModified = False Then

    ' Get a new comment from the user via Inputbox popup
    newComment = InputBox("You need to add a comment before your changes can be saved")

    ' Make sure the user has entered something
    If Len(Trim(newComment)) > 0 Then
    ' Append the new comment to the record
    Bug_Fields("BG_DEV_COMMENTS").Value = Bug_Fields("BG_DEV_COMMENTS").Value & vbcr & newComment

    ' If no new comment was entered into the input box, don't post.
    Defects_Bug_CanPost = False
    End If
    End If

    On Error GoTo 0
    End Function

    You can add formatting, timestamps etc to the comment if you wish, but the above code is a quick 2 minute job that answers your question. Be aware that what you've asked for may irritate your users - a new comment for every single change. You might want to tone this down a bit..

    ... just another Tester ...

  4. #4
    Hi Alex, you mentioned in this post that
    "You can add formatting, timestamps etc to the comment if you wish, but the above code is a quick 2 minute job that answers your question" can you show how to add timestamps and the user responsible to comments automatically please? We have an issue of developers not using the 'Add Comment' button which adds their name and date to the comment

  5. #5



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:53 PM.

Copyright BetaSoft Inc.