Add Comment to Existing Item

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
cs
Posts: 126
Joined: Mon Apr 11, 2005 5:20 am

Add Comment to Existing Item

Post by cs » Tue Feb 05, 2008 6:21 am

Hi,

I am trying to add a comment onto an existing item in Fortress, how do I do this?

I am currently using MantisItemComment and MantisItemCommentColl.

Thanks for any assistance.

shannon

Post by shannon » Tue Feb 05, 2008 9:04 am

You can use ItemTrackingOperations.ProcessCommandAddFortressItemComment. All you need is the bug id.

cs
Posts: 126
Joined: Mon Apr 11, 2005 5:20 am

Post by cs » Tue Feb 05, 2008 9:14 am

Thanks for the feedback that worked for me.

Is there also a way of adding a new comment onto an existing item with a subject and a comment?

Thanks

shannon

Post by shannon » Tue Feb 05, 2008 9:28 am

There is no convenience method for setting the subject, but you could do it like this:

Code: Select all

MantisItemFullDetail mifd = ProcessCommandListFortressItemFullDetails(bugID);

MantisItem mi = new MantisItem(mifd);

mi.ChangeComment = new MantisItemComment(bugID, uid, ulogin, subject, comment);
mi.ChangeComment.Html = useHtml;

ServerOperations.client.ClientInstance.ModifyItem2(ref mi);

cs
Posts: 126
Joined: Mon Apr 11, 2005 5:20 am

Post by cs » Tue Feb 05, 2008 10:14 am

Thanks very much, that was exactly what I needed.

cs
Posts: 126
Joined: Mon Apr 11, 2005 5:20 am

E-Mail Notification

Post by cs » Mon Feb 11, 2008 6:33 am

The e-mail notification text appears to be different from a regular comment added using the web client.

I receive:

a) 'JoeUser has modified item...'

instead of the expected:

b) 'JoeUser has commented on...'

How can I add a comment using the API which will generate e-mail notification style b) above?

shannon

Post by shannon » Mon Feb 11, 2008 9:41 am

There isn't currently a way to do this from the api, but I can take a feature request if you'd like.

cs
Posts: 126
Joined: Mon Apr 11, 2005 5:20 am

Post by cs » Mon Feb 11, 2008 10:50 am

If you could add that as a request that would be great.

Thank you.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Fri May 30, 2008 2:28 pm

Fortress 1.1.2 will now correctly supports a subject and uses the comment web service method instead of the modify web service method.
Subscribe to the Fortress/Vault blog

Post Reply