This article describes how to create issues using the SystemWeaver API.


To be able to do this, you will first need to obtain the project Handle


Example

string projectHandle = "x26000000000128E9";
IswItem item = SWConnection.Instance.Broker.GetItem(SWHandleUtility.ToHandle(TextBoxId.Text));
IswProject project = SWConnection.Instance.Broker.GetProject(SWHandleUtility.ToHandle(projectHandle));

IswIssueTypes issueTypes = project.Definition.IssueTypes;

// Get relevant issueType. In this case we just pick the first one.
IswIssueType type = issueTypes[0];

// Create issue
IswIssue newIssue = project.AddIssue(type, "AName");

// To set the status, Get the issue workflow.
IswWorkflow workFlow = newIssue.swIssueType.Workflow;

// Select a status and assign it to the issue.
IswWorkflowStatuses statuses = workFlow.Statuses;
newIssue.Status = statuses[0];

// Add a reference, the SID IR is the default issue relation.
newIssue.AddObjRef("IR", item);