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
New Member.

Need the code to add comment in Quality Center defect using VBA.

Need the code to addcomment in QC defect using VBA. It should work exactly the same way as we do it manually. Manual Steps:

1) Open Defect in QC.

2) Click on Add Comment button. It automatically adds user name timestamp etc. as below

ShraddhaG <username>,  11/16/2018 12:13:00 GMT:  

3) Then we write our comment 

4) Click on Ok.

This way we are retaining old comments and only adding new comment.

Can someone help me with the code for this using vba? I have the below code, but it replaces old comments with new one and does not even adds username, timestamp etc..

Function ActionCanExecute(Action_Name, Bug)

AddDevComment= True 'BugAddDevCommentsAction1, AddDevComment
Bug.Field("BG_DEV_COMMENTS") = "Comment body"

End Function

Thanks in advance.

Tags (3)
1 Reply
Jesus Martinez Respected Contributor.
Respected Contributor.

Re: Need the code to add comment in Quality Center defect using VBA.

Hi ShraddhaG,

In order to keep the old comments value I recommend you to use.  

Bug.Field("BG_DEV_COMMENTS").Value =  Bug.Field("BG_DEV_COMMENTS").Value + "This is a comment" 

Now, due you need to get the username and timestamp the best opiton here is to get thye help from the professional services team. Regarding your request , the customization that you want to apply needs and specialized assistance , for that I am gald to send you the information aobut our Professional services team specialized in workflow code and customizations.

This team is in charge of some activities that are beyond the standard support contract which causes over-delivery:

1- Step-by-step installation (hand holding).

2- Deployment services.

3- Custom code creation.

4- Training or Educational Services.

You can know how to contact them in thel ink below: 


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.