Skip to content

create_related_item

create_related_item(
    domain_id: DomainId,
    case_id: CaseId,
    type: RelatedItemType,
    content: RelatedItemInputContent,
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    performed_by: Optional[UserUnion] = None,
) -> CreateRelatedItemResponse

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

Important things to know

  • If you are associating a contact to a case by passing in Contact for a type, you must have DescribeContact permission on the ARN of the contact that you provide in content.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, the relatedItemArn. Examples of related items include comments and contacts.

  • If you provide a value for performedBy.userArn you must also have DescribeUser permission on the ARN of the user that you provide.

  • The type field is reserved for internal use only.

Endpoints: See Amazon Connect endpoints and quotas.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the Cases domain.

  • case_id (CaseId) –

    A unique identifier of the case.

  • type (RelatedItemType) –

    The type of a related item.

  • content (RelatedItemInputContent) –

    The content of a related item to be created.

  • performed_by (Optional[UserUnion], default: None ) –

    Represents the creator of the related item.

Raises:

Source code in docs_src/capo_connectcases/_services/connect_cases.py
def create_related_item(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    case_id: "capo_connectcases.types.case_id.CaseId",
    type: "capo_connectcases.types.related_item_type.RelatedItemType",
    content: "capo_connectcases.types.related_item_input_content.RelatedItemInputContent",
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    performed_by: Optional["capo_connectcases.types.user_union.UserUnion"] = None,
) -> (
    "capo_connectcases.types.create_related_item_response.CreateRelatedItemResponse"
):
    """<p>Creates a related item (comments, tasks, and contacts) and associates it with a case.</p> <p>There's a quota for the number of fields allowed in a Custom type related item. See <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#cases-quotas">Amazon Connect Cases quotas</a>.</p> <p> <b>Use cases</b> </p> <p>Following are examples of related items that you may want to associate with a case:</p> <ul> <li> <p>Related contacts, such as calls, chats, emails tasks</p> </li> <li> <p>Comments, for agent notes</p> </li> <li> <p>SLAs, to capture target resolution goals</p> </li> <li> <p>Cases, to capture related Amazon Connect Cases</p> </li> <li> <p>Files, such as policy documentation or customer-provided attachments</p> </li> <li> <p>Custom related items, which provide flexibility for you to define related items that such as bookings, orders, products, notices, and more</p> </li> </ul> <p> <b>Important things to know</b> </p> <ul> <li> <p>If you are associating a contact to a case by passing in <code>Contact</code> for a <code>type</code>, you must have <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeContact.html">DescribeContact</a> permission on the ARN of the contact that you provide in <code>content.contact.contactArn</code>.</p> </li> <li> <p>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 <code>contactArn</code>). All Related Items have their own internal identifier, the <code>relatedItemArn</code>. Examples of related items include <code>comments</code> and <code>contacts</code>.</p> </li> <li> <p>If you provide a value for <code>performedBy.userArn</code> you must also have <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">DescribeUser</a> permission on the ARN of the user that you provide.</p> </li> <li> <p>The <code>type</code> field is reserved for internal use only.</p> </li> </ul> <p> <b>Endpoints</b>: See <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect endpoints and quotas</a>.</p>

    Args:
        domain_id: <p>The unique identifier of the Cases domain. </p>
        case_id: <p>A unique identifier of the case.</p>
        type: <p>The type of a related item.</p>
        content: <p>The content of a related item to be created.</p>
        performed_by: <p>Represents the creator of the related item.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
        capo_connectcases.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded. For a list of service quotas, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
        capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
        capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connectcases.types.create_related_item_request.CreateRelatedItemRequest]",
    ) -> OperationResponse[
        "capo_connectcases.types.create_related_item_response.CreateRelatedItemResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.create_related_item

        output, http_response = (
            capo_connectcases._operations.amazon_connect_cases.create_related_item.create_related_item(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_connectcases.types.create_related_item_request.CreateRelatedItemRequest",
    ) -> dict[str, Any]:
        import capo_connectcases.types.create_related_item_request

        return capo_connectcases.types.create_related_item_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateRelatedItem", redact_input=_redact_input),
    )
    input_: capo_connectcases.types.create_related_item_request.CreateRelatedItemRequest = {
        "domain_id": domain_id,
        "case_id": case_id,
        "type": type,
        "content": content,
    }
    if performed_by is not None:
        input_["performed_by"] = performed_by

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output