Hi,
I'm new to Clarizen. We're using v6. I'm trying to import a few hundred "items" from "the old system". Each item has zero or more comments associated with it.
I think I want to import these items as "EnhancementRequest" types (subtype of Case), and map the old "comments" to the "Discussion" entity type (a subtype of Comment).
Basing myself on the C# sample from Clarizen, I can create a "Note" (also a subtype of Comment) with the following code.
So this works:
<code>
private void AddNoteToEntity(EntityId caseEntityId)
{
GenericEntity comment = new GenericEntity();
comment.Id = new EntityId();
comment.Id.TypeName = "Note";
FieldValue commentTextValue = new FieldValue();
commentTextValue.FieldName = "Comment";
commentTextValue.Value = "A new comment added " + DateTime.UtcNow.ToLongDateString();
FieldValue attachedToValue = new FieldValue();
attachedToValue.FieldName = "AttachedTo";
attachedToValue.Value = caseEntityId;
comment.Values = new FieldValue[] { commentTextValue, attachedToValue };
CreateMessage createDocument = new CreateMessage();
createDocument.Entity = comment;
Result[] results = clarizen.Execute(new BaseMessage[] { createDocument });
Utils.CheckResponseStatus(results);
}
</code>
But if I change
<code>comment.Id.TypeName = "Note";</code>
to
<code>comment.Id.TypeName = "Discussion";</code>
I receive an error stating that the type "Discussion" does not exist.
Alternatively, if I change:
<code>comment.Id.TypeName = "Note";</code>
to
<code>comment.Id.TypeName = "Comment";</code>
I also get an error stating: "Object of a not leaf class 'Collaboration Items' cannot be created"
My guess is the second error is Clarizen's way of telling me it can't create an instance of an abstract type.
But the first error is baffling; how do I create Discussions from the API?
Thanks for any assistance!