Skip to content

groups.Create

Overview

Create a new group from "Server Script". This is a method of the groups object.

Methods

groups.Create(group);

Parameters

Parameter Description Required
group Specify the group information to create as a JSON string. Yes

Usage Examples

The following example creates a new group.

(function () {
    const group = {
        GroupName: "New Group",
        Body: "dddddd",
        Disabled: false,
        Comments: "created-by-server-script",
        ClassHash: {
            ClassA: "test-class-column"
        }
    };

    const ok = groups.Create(JSON.stringify(group));
    context.Log("groups.Create returned:", ok);
})();

Return Value

Type Description
boolean Returns true if the group is created successfully, and false if it fails.

Setting Values for Extended Columns

To set values for "Extended Column", specify the column name and value in ClassHash.

ClassHash: {
    ClassA: "test-class-column"
}

Supported Versions

Supported versions Body
1.5.8.0 and later Added function