Page 1 of 1

Add Comment to Existing Item

Posted: Tue Feb 05, 2008 6:21 am
by cs
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.

Posted: Tue Feb 05, 2008 9:04 am
by shannon
You can use ItemTrackingOperations.ProcessCommandAddFortressItemComment. All you need is the bug id.

Posted: Tue Feb 05, 2008 9:14 am
by cs
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

Posted: Tue Feb 05, 2008 9:28 am
by shannon
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);

Posted: Tue Feb 05, 2008 10:14 am
by cs
Thanks very much, that was exactly what I needed.

E-Mail Notification

Posted: Mon Feb 11, 2008 6:33 am
by cs
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?

Posted: Mon Feb 11, 2008 9:41 am
by shannon
There isn't currently a way to do this from the api, but I can take a feature request if you'd like.

Posted: Mon Feb 11, 2008 10:50 am
by cs
If you could add that as a request that would be great.

Thank you.

Posted: Fri May 30, 2008 2:28 pm
by jeremy_sg
Fortress 1.1.2 will now correctly supports a subject and uses the comment web service method instead of the modify web service method.