ConnectCases / Client / batch_update_case

batch_update_case

ConnectCases.Client.batch_update_case(**kwargs)

Updates fields on multiple cases in a single request. All cases must belong to the same domain. Set the title, status, and customer ID through the top-level title, status, and customerId parameters, and set other fields through the fields array.

Each case is processed independently. If some cases fail, the remaining cases are still updated. To determine whether individual cases failed, inspect the failedCases array in the response.

The entire request fails, and no cases are updated, in the following cases:

  • The specified domain doesn’t exist.

  • A reference ID doesn’t match any case in the domain.

  • The request contains duplicate case IDs.

  • The request doesn’t specify any update. Provide at least one entry in fields, or a title, status, or customerId.

  • A field identifier in fields doesn’t resolve to a field in the domain, for example, an unknown field name.

  • A field name contains a pipe ( |) or comma ( ,) character.

  • fields includes title, status, or customerId.

Note

This operation uses the same IAM action as UpdateCase ( cases:UpdateCase). You can use the cases:IsBatchAction condition key in IAM policies to allow or deny batch operations independently from single-case operations.

Note

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

Endpoints: See Connect Customer endpoints and quotas.

See also: AWS API Documentation

Request Syntax

response = client.batch_update_case(
    domainId='string',
    cases=[
        {
            'caseIdentifier': {
                'caseId': 'string',
                'referenceId': 'string'
            }
        },
    ],
    fields=[
        {
            'fieldIdentifier': {
                'id': 'string',
                'name': 'string'
            },
            'value': {
                'stringValue': 'string',
                'doubleValue': 123.0,
                'booleanValue': True|False,
                'emptyValue': {}
                ,
                'userArnValue': 'string'
            }
        },
    ],
    performedBy={
        'userArn': 'string',
        'customEntity': 'string'
    },
    title='string',
    status='string',
    customerId='string',
    clientToken='string'
)
Parameters:
  • domainId (string) –

    [REQUIRED]

    The unique identifier of the Cases domain.

  • cases (list) –

    [REQUIRED]

    The list of cases to update. All cases must belong to the same domain.

    • (dict) –

      Identifies a case to update in a BatchUpdateCase request.

      • caseIdentifier (dict) – [REQUIRED]

        The identifier of the case to update. Specify either the case ID or the reference ID.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: caseId, referenceId.

        • caseId (string) –

          The unique identifier of the case.

        • referenceId (string) –

          The reference ID of the case. Reference IDs are unique within a domain, and uniqueness isn’t case sensitive.

  • fields (list) –

    [REQUIRED]

    An array of objects, each with a fieldIdentifier and a value. You can identify each field by its ID or by its name; identifying a field by name is supported only in BatchUpdateCase. The same field values are applied to every case in the request. This field must be present, but can be an empty list when you provide the top-level title, status, or customerId parameters. Do not include title, status, or customerId in this list; set those values only through their top-level parameters. Duplicating them in fields results in a validation error.

    • (dict) –

      A field and the value to set for it.

      • fieldIdentifier (dict) – [REQUIRED]

        The field to update, identified by field ID or field name.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: id, name.

        • id (string) –

          The unique identifier of the field.

        • name (string) –

          The name of the field.

      • value (dict) – [REQUIRED]

        The value to set for the field.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: stringValue, doubleValue, booleanValue, emptyValue, userArnValue.

        • stringValue (string) –

          String value type.

        • doubleValue (float) –

          Can be either null, or have a Double number value type. Only one value can be provided.

        • booleanValue (boolean) –

          Can be either null, or have a Boolean value type. Only one value can be provided.

        • emptyValue (dict) –

          An empty value.

        • userArnValue (string) –

          Represents the user that performed the audit.

  • performedBy (dict) –

    The entity that performed the action.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: userArn, customEntity.

    • userArn (string) –

      Represents the Connect Customer ARN of the user.

    • customEntity (string) –

      Any provided entity.

  • title (string) – The title to apply to all cases in the request.

  • status (string) – The status to apply to all cases in the request.

  • customerId (string) – The ARN of the customer profile to associate with all cases in the request.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

    If you retry a request with the same client token, the service returns the original response instead of processing the request again. If you reuse a client token with different request parameters, the request fails with a ConflictException.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'successfulCases': [
        {
            'caseIdentifier': {
                'caseId': 'string',
                'referenceNumber': 'string',
                'referenceId': 'string'
            }
        },
    ],
    'failedCases': [
        {
            'caseIdentifier': {
                'caseId': 'string',
                'referenceNumber': 'string',
                'referenceId': 'string'
            },
            'errorCode': 'string',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • successfulCases (list) –

      The list of cases that were successfully updated.

      • (dict) –

        Information about a case that was updated.

        • caseIdentifier (dict) –

          The identifiers of the updated case.

          • caseId (string) –

            The unique identifier of the case.

          • referenceNumber (string) –

            The reference number of the case. Reference numbers aren’t guaranteed to be unique. BatchUpdateCase and BatchCreateRelatedItem don’t return this value.

          • referenceId (string) –

            The reference ID of the case. Cases created before reference IDs were available don’t have one.

    • failedCases (list) –

      The list of cases that were not updated. Each entry includes an error code and message. Possible error codes include:

      • CASE_NOT_FOUND - No case exists with the specified case ID.

      • VALIDATION_ERROR - The request contains invalid input.

      • CONFLICT - Another operation is in progress on the case, such as a concurrent update or a merge of the case into another case.

      • THROTTLED - The request rate exceeded the allowed limit.

      • ACCESS_DENIED - The caller lacks permission to perform the operation.

      • SERVICE_QUOTA_EXCEEDED - The request exceeded a service quota.

      • DOMAIN_NOT_FOUND - The case domain was deleted while the request was being processed.

      • INTERNAL_ERROR - An unexpected error occurred on the server.

      • (dict) –

        Information about a case that wasn’t updated.

        • caseIdentifier (dict) –

          The identifiers of the case that wasn’t updated.

          • caseId (string) –

            The unique identifier of the case.

          • referenceNumber (string) –

            The reference number of the case. Reference numbers aren’t guaranteed to be unique. BatchUpdateCase and BatchCreateRelatedItem don’t return this value.

          • referenceId (string) –

            The reference ID of the case. Cases created before reference IDs were available don’t have one.

        • errorCode (string) –

          The error code. For possible values, see failedCases.

        • errorMessage (string) –

          A message that describes the error.

Exceptions