Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Creating a SubIssue throwing an exception

api

Hello, I am trying to create a new subissue and add it to an existing issue, I am using the following code:

        var issues = serviceManager.IssuesService.GetFilteredIssues(issuesFilter);
        var roomIssue = issues.FirstOrDefault(issue => issue.IssueSummary.Contains("105"));


        var newIssue = new CounterSoft.Gemini.Commons.Entity.IssueEN();
        newIssue.ProjectID = project.ProjectID;
        newIssue.IssueSummary = "Trying to add a new issue to this existing issue";
        newIssue.IssueLongDesc = "This will describe a problem.";
        newIssue.ReportedBy = 1;

        var fromServer = serviceManager.IssuesService.CreatePartialIssue(newIssue);

        serviceManager.IssuesService.CreateSubIssue(roomIssue.IssueID, fromServer);

This blows with an exception of "Issue Id does not match saved data Id value: 105."

Any ideas?

Thanks!

matrix4123
· 1
matrix4123
Replies (5)
helpful
0
not helpful

You need to set the parent issue id property of sub issue before calling the create sub issue method.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Cool, that appeared to work, except now I am seeing two sub-issues being created as a result... All I added was the ParentIssueID statement. Should I not be calling the CreatePartialIssue first?

Thanks!


matrix4123
· 1
matrix4123
helpful
0
not helpful

Yes, create sub issue, creates the issue.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

I figured out a way to only make it create one issue...

        var issues = serviceManager.IssuesService.GetFilteredIssues(issuesFilter);
        var roomIssue = issues.FirstOrDefault(issue => issue.IssueSummary.Contains("105"));


        var newIssue = new CounterSoft.Gemini.Commons.Entity.IssueEN();
        newIssue.ProjectID = project.ProjectID;
        newIssue.IssueSummary = "Trying to add a new issue to this existing issue";
        newIssue.IssueLongDesc = "This will describe a problem.";
        newIssue.ReportedBy = 1;
        newIssue.ParentIssueID = roomIssue.IssueID;

        var fromServer = serviceManager.IssuesService.CreatePartialIssue(newIssue);

I just don't call CreateSubIssue anymore. Might you have an example of using the CreateSubIssue correctly?

Thanks again.


matrix4123
· 1
matrix4123
helpful
0
not helpful

That is one way of doing it (might be better if you want to populate the issue with partial data).
to use create sub issue, do the same as you did above and populate all the issue data (type, priority, component etc...) and pass it to the create sub issue method with the parent issue id as the 1st parameter


Saar Cohen
· 5000
Saar Cohen