Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Established Member.. JoSidarta
Established Member..

Best Practice to add Defect Comments programmatically

With ALM 12.53, the Comments field has HTML format, what is the best method to append an additional comments in there programatically?

Reason: if I only add a simple text, for instance (inside Bug_CanPost function):

Bug_Fields.Field("BG_DEV_COMMENTS").value = Bug_Fields.Field("BG_DEV_COMMENTS").value & "xyz"

The next time I click on "Add Comments" from the GUI, it will append various HTML code to that line:

<div align="left" style="min-height: 9pt;"><font face="Arial"><span style="font-size:8pt">xyz</span></font></div>


Also, should I call "BugAddDevCommentsAction1" and "FieldComments.AddComment" beforehand too (note: these two actions are called when user click on "Add Comments" manually from the GUI



Labels (1)
2 Replies
Minh P Valued Contributor.
Valued Contributor.

Re: Best Practice to add Defect Comments programmatically


Please try to add TDConnection.IgnoreHtmlFormat =false  before the workflow event exits.


(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Best Practice to add Defect Comments programmatically

When you concatenate a string to the end of an existing text in a memo field, you first need to remove the end tags "</body></html>" from the memo field.

Then after performing the concatenation and before posting, readd the end tags at the end of the new complete string.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
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.