Skip to content

CreateCase

Creates a new Case with the specified input.

1
$Domain.CreateCase(channelId: string, inputData: CaseCreateOptions):Case

Parameters

string channelId
    The ID of the channel to create the case in.

CaseCreateOptions inputData
    The case properties.

Returns

The created Case instance.

Remarks

The channel identifier must be a valid channel GUID in the current domain. The operation creates and persists a new case immediately with the current domain ID and current time; it does not infer a channel from the input object.

Examples

Create a case with a deadline

1
2
3
4
5
6
7
8
9
var newCase = $Domain.CreateCase($Xml.Evaluate('ChannelId'), {
    Subject : 'Complaint from ' + $Xml.Evaluate('Customer/Name'),
    Description : $Xml.Evaluate('Complaint'),
    Priority : 3,
    DeadlineAt : $Calendar.AddDays($Calendar.Today, 2)
});

newCase.AddTag('Complaint');
$Xml.SetValue('CaseId', newCase.Id);

See Also