createRelatedItem method
Creates a related item (comments, tasks, and contacts) and associates it with a case.
There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.
Use cases
Following are examples of related items that you may want to associate with a case:
- Related contacts, such as calls, chats, emails tasks
- Comments, for agent notes
- SLAs, to capture target resolution goals
- Cases, to capture related Amazon Connect Cases
- Files, such as policy documentation or customer-provided attachments
- Custom related items, which provide flexibility for you to define related items that such as bookings, orders, products, notices, and more
-
If you are associating a contact to a case by passing in
Contactfor atype, you must have DescribeContact permission on the ARN of the contact that you provide incontent.contact.contactArn. -
A Related Item is a resource that is associated with a case. It may or may
not have an external identifier linking it to an external resource (for
example, a
contactArn). All Related Items have their own internal identifier, therelatedItemArn. Examples of related items includecommentsandcontacts. -
If you provide a value for
performedBy.userArnyou must also have DescribeUser permission on the ARN of the user that you provide. -
The
typefield is reserved for internal use only.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter caseId :
A unique identifier of the case.
Parameter content :
The content of a related item to be created.
Parameter domainId :
The unique identifier of the Cases domain.
Parameter type :
The type of a related item.
Parameter performedBy :
Represents the creator of the related item.
Implementation
Future<CreateRelatedItemResponse> createRelatedItem({
required String caseId,
required RelatedItemInputContent content,
required String domainId,
required RelatedItemType type,
UserUnion? performedBy,
}) async {
final $payload = <String, dynamic>{
'content': content,
'type': type.value,
if (performedBy != null) 'performedBy': performedBy,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/domains/${Uri.encodeComponent(domainId)}/cases/${Uri.encodeComponent(caseId)}/related-items/',
exceptionFnMap: _exceptionFns,
);
return CreateRelatedItemResponse.fromJson(response);
}