Interface Attribute

Attribute of some building block types. Values of the specified type can be assigned to instances of those building block types.

interface Attribute {
    attributeGroup: string;
    buildingBlocks: BuildingBlockType[];
    description: string;
    includeAllUsers?: boolean;
    lastModificationTime: string;
    lastModificationUser: string;
    literals?: ResponsibilityLiteral[] | EnumerationLiteral[];
    mandatory: boolean;
    multiassignmenttype?: boolean;
    name: string;
    type: PropertyType;
    users?: ResponsibilityLiteral[];
    createEnumerationLiteral(
        name: string,
        description: string,
        color: string,
    ): boolean;
    createResponsibilityLiteral(userEntityId: number, color: number): boolean;
    removeEnumerationLiteral(name: string): boolean;
    removeResponsibilityLiteral(userEntityId: number): boolean;
}

Properties

attributeGroup: string

Attribute group to which the attribute is assigned

buildingBlocks: BuildingBlockType[]

Persistent names of the building block types to which instances a value of this attribute can be assigned

description: string
includeAllUsers?: boolean

Whether all user can possibly be assigned

Only available for responsibility attributes

lastModificationTime: string

Time at which the attribute was last modified

This will have format "{{Day of week}} {{Month}} {{Day of Month}} {{Year}} {{Hour}}:{{Minute}}:{{Second}} {{Timezone}}" So for example "Tue Mar 24 2020 12:51:02 GMT+0100 (CET)"

lastModificationUser: string

User who last modified the attribute

This will have the format "{{FIRST NAME}} {{LAST NAME}} ({{USERNAME}})" (so for example "Joe Smith (joe)")

// Gets the user information from the "lastModificationUser" string
var userString = changedObject.getValue('lastModificationUser');
var loginName = userString.substring(userString.indexOf("(")+1, userString .length-1);
var lastModificationUser = api.user.get(loginName);

Literals (possible values) of this enumeration/responsibility attribute

Only available for enumeration/responsibility attributes

mandatory: boolean

Whether building blocks with this attribute have to have a value assigned to this attribute.

multiassignmenttype?: boolean

Whether this attribute can hold multiple values at once

Only available for responsibility/enumeration attributes

name: string

use literals instead Users and user groups which have a corresponding literal for this responsibility attribute

Only available for responsibility attributes

Methods

  • Create literal for an existing enumeration attribute

    Parameters

    • name: string

      Name of the enumeration literal

    • description: string

      Description for the enumeration literal

    • color: string

      Color to associate with the enumeration literal

    Returns boolean

    Only available for enumeration attributes

  • Create literal for an existing responsibility attribute

    Parameters

    • userEntityId: number

      Id of the user or user group to which the literal should refer to

    • color: number

      Color to associate with the responsibility literal

    Returns boolean

    Only available for responsibility attributes

  • Remove literal for an existing enumeration attribute

    Parameters

    • name: string

      Name of the enumeration literal

    Returns boolean

    Only available for enumeration attributes

  • Remove literal for an existing responsibility attribute

    Parameters

    • userEntityId: number

      Id of the user or user group to which the literal refers to

    Returns boolean

    Only available for responsibility attributes