VB.Net CreateIssueComment is throwing exception
I'm trying to create a comment using the .Net API and I am getting a "Exception has been thrown by the target of an invocation. Project Id does not match saved data Id value: 0." error when calling the CreateIssueComment method. Here is my code:
Dim issueComment As New IssueCommentEN
With issueComment
.IssueID = GeminiIssue.IssueID
.Comment = "string value"
.Attachment = issueAttach
.ProjectID = GeminiIssue.ProjectID
End With
Dim CreateIssueComment = smProxyManager.IssuesService.CreateComment(GeminiIssue.IssueID, issueComment)
Am I doing something wrong?
JeremyJ
· 1 |
|
Thursday, August 25, 2011, 4:09:21 PM |
0
|
You need to set the UserID, also check the Gemini system log for errors. |
||||
|
0
|
Where do I set the UserID? I've changed my code a little, but is still throws the error. It is strange because it does actually create the comment on the ticket, but it doesn't add the attachment.
|
||||
|
1
|
ANSWER
Did you check the error in the Gemini system log? |
||||
|
0
|
Here is the error: Project Id does not match saved data Id value: 0. at CounterSoft.Gemini.Presenter.Base.BasePresenter.HandleIdMismatchException(String message, Int32 id) at CounterSoft.Gemini.Presenter.Base.BasePresenter.HandleProjectIdMismatchException(Int32 projectId) at CounterSoft.Gemini.Presenter.IssuePresenter.CreateCommentAttachment(IssueEN issue, IssueCommentEN comment, FileEN attach) at CounterSoft.Gemini.Presenter.IssuePresenter.CreateIssueComment(IssueEN issue, IssueCommentEN comment) at CounterSoft.Gemini.Web.Api.IssuesRestHandler.CommentCreate(RequestDetails rd) Basically, I wasn't setting the ProjectId property of the FileEN. This works now:
|
||||
|
0
|
Thank you! |
||||
|