Change case of activities

Overview

Use this API to change the case of one or more open activities of the same case. The target case can be a new case or an existing case.

For this API to execute successfully:

  • All activities must exist in the application.
  • All activities must belong to the same case and the case must exist in the application.
  • The status of all activities in the request must be "in queue waiting to be assigned" or "assigned to a user".
  • The customer associated with both the original and the target case must be the same.
  • If the target case is an existing case, the case ID must be an existing case ID.
  • If a response exists for any of the activities in the request body, they must be in "Completed" status.
  • No more than 75 activities must be sent in one request.

As part of completing this API request:

  • If the target case is closed, it reopens.
  • If the source case is left with no open activities, it is closed.
  • If any of the activities have responses which are in "Completed" status, the case of these activities are also changed.
  • If the target case is a new case:
    • The new case are created in the same department as the original case.
    • The case is created with an open status.
    • The owner of the new case is the same as the original case.
    • The customer of the new case is the same as the original case. If the original case does not have a customer, the new case does not have a customer either.
    • The originatingChannel for the new case is the same as original case.

Permissions

Actor Permission
User All of the following are required:
  • Must have "Change Case" action on "Activity" resource.
  • All the activities must either belong to the logged in user's home department, or to a department in which the user is a foreign user.
Client Application No additional permission required.

Licenses

Actor License
User The logged in user must have the following licenses:
  • eGain Advisor Desktop or eGain MailPlus: To change the case of email or social activities.
  • eGain Advisor Desktop or eGain CallTrackPlus: To change the case of calltrack activities.
  • Any User License: To change the customer of other activity types. Refer Licenses section for more information.
Client Application No additional licenses required.
SecurityoAuthUser or oAuthClient
Request
path Parameters
ids
required
string

A single activity id or comma separated string of activity IDs that belong to the same case.

Examples:
Providing single ID.
1001
Providing multiple IDs.
1010,1020,1300
query Parameters
relateCase
string

This is required to relate the current case with the new case of the activities.

Value: "yes"
header Parameters
Accept
required
string
Default: application/json

Content type accepted by client.

Enum: "application/json" "application/xml"
Accept-Language
required
string
Default: en-US

Language locale accepted by client (used for locale specific fields in resource representation and in error responses).

Enum: "en-US" "es-ES" "fr-FR" "it-IT" "de-DE" "nl-NL" "pt-BR" "pt-PT" "da-DK" "ru-RU" "fr-CA" "zh-CN" "ja-JP" "ko-KR" "sv-SE"
Request Body schema: application/json

The request body is mandatory. The request body varies depending on whether the target case for activities is a new case or an existing case.

Elements required in request body for existing case

Name Description
id Must be an existing case ID in the application.

Optional elements allowed in request body for existing case

None

Elements required in request body for new case

None, although request body must be present with the case element.

Optional elements allowed in request body for new case

Name Description
case.dueDate Case due date. Must be a valid date, in the future.
case.severity.value Case severity value. Must be 'urgent', 'high', 'medium' or 'low'.
case.subject Case subject. If not provided, the subject of the original case would be used as the subject of the case as well. Must not exceed 1024 characters.
case.description Case description.
case.solution Case solution.
case.customAttributes Names of the custom attributes must exist in eGain application. If the attribute is an enumeration, the values sent must be one from the list of allowed values.
Array of objects (link) >= 0 items

Self link that can be used to retrieve this case.

object (activities)

Field holding a link that can be used to retrieve all activities of this case.

object (department)

Department of the case.

object (status)

Status of the case.

lastModified
string <date-time> (lastModified)

Last modified date of the case.

object (lastModifiedBy)

Details of the last modification of the case (user info).

dueDate
string <date-time> (dueDate)

Due date of the case.

object (owner)

Owner of the case.

object (customer)

Customer associated with the case (ID, name and self-link).

object (severity)

Severity of the case.

subject
string (subject) <= 1024 characters

Subject of the case.

object (originatingChannel)

Originating Channel of the case.

created
string <date-time> (created)

Create date of the case.

object (created)

Case creation details (user info).

description
string (description) <= 1024 characters

Description of the case.

solution
string (solution) <= 1024 characters

Solution of the case.

object (userLastWorked)

Details of the last user or agent who worked on any activity of this case.

object (relatedCases)

List of cases related to the current case.

object (customAttributes)

Name and value of all the custom attributes configured for the Case Object.

Array of objects (notes) >= 0 items

Contains link that can be used to retrieve all notes of this case.

id
string (id)

Case ID.

lastClosed
string <date-time> (lastClosed)

Last closed date of the closed case.

Responses
201

Created

  • Successfully created a new case and changed the case of the activities the newly created case. The response contains a "Location" header indicating the URI of the newly created case.
204

No Content

  • Successfully changed the case of the activities to the target case.
400

Bad Request

  • Unsupported query parameter is sent in the request.
  • Unsupported query parameter value is sent in the request.
  • Request body does not contain the required elements.
  • Unsupported element is present in the request body.
  • Any criteria for successful execution mentioned in the Overview and Request Body sections are violated.
401

Unauthorized

403

Forbidden

  • The user does not have sufficient permissions.
  • One or more activities sent in the request are locked by another user.
404

Not Found

  • One or more activities in the request URI do not exist.
406

Not Acceptable

500

Internal server error

patch/activity/{ids}/changecase
Request samples
application/json
  • PATCH /core/casemgr/v3/activity/1005/changecase
  • This example demonstrates the following:
    • Changing the case of a single activity to a new case. The new case is created without any optional attributes. Since all attributes of a case are optional, the case is created without providing any attributes.
{ }
Response samples
application/json
{
  • "code": "400-101",
  • "developerMessage": "Unsupported query parameter(s) supplied: '<query_parameter>'."
}