- Home [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- Getting started
- Use cases
-
API
-
Object types
- DispositionType
- ProcessInstanceState
- ProcessTaskState
- ApplicationItemRegistration
- ApplicationProjectItem
- ApplicationProjectItemRef
- ApplicationProjectPlanElementItem
- ApplicationProjectPlanElementItemRef
- BaseApplicationItem
- BaseApplicationItemRef
- BaseItem
- BaseItemData
- CurrentUserItem
- DirectoryData
- DirectoryItem
- EmployeeItemData
- EmployeeItemParams
- EmployeeItemProcesses
- FileData
- FileItem
- FileItemRef
- FileVersionData
- FileVersionItem
- ImageData
- ImageItem
- ImageItemRef
- InstanceAddr
- Item
- ItemData
- ItemRef
- MailMessageData
- MailMessageItem
- MailMessageItemRef
- OrganisationStructureData
- OrganisationStructureItem
- OrganisationStructureItemRef
- ParamsItem
- ProcessInstanceData
- ProcessInstanceItem
- ProcessInstanceItemRef
- ProcessTaskData
- ProcessTaskItem
- ProcessTaskItemRef
- ProcessTemplate
- ProcessTimer
- ReminderData
- ReminderItem
- ReplacementData
- ReplacementItem
- StatusHistoryData
- StatusHistoryItem
- StatusHistoryItemRef
- TaskItemExit
- UserData
- UserGroupData
- UserGroupItem
- UserGroupItemRef
- UserItem
- UserItemRef
- ApplicationItem
- ApplicationItemRef
- Data types
- Global constants
- Work with apps
- Web requests
- Access permissions
- Document flow
- Live Chats
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
-
Object types
Organizational chart item
This item represents an org chart item: a job position, a department, or a group. The type has no constructor. You can create a new item using the OrganisationStructure.createItem method:
const item = System.organisationStructure.createItem('Chief Development Officer', OrganisationStructureItemType.Position);
To add a newly created item to an existing org chart (to a specified parent), use the
OrganisationStructureItem.addChild method. When changes to the org chart are made, save it using the OrganisationStructure.save method.
const tree = await System.organisationStructure.fetchTree(); tree.getRoot().addChild(item); const errs = await System. organisationStructure.save(tree); if (errs.length === 0) { Context.data.debug = 'Saved successfully'; }
Type parameters
I: Item<ItemData>
I: Item<ItemData>
Hierarchy
Properties
Readonly code
App code of the URL’s target (the app’s code).
Readonly data
Values of object’s fields.
Readonly fields
Description of the object’s fields.
Readonly id
ID of the URL’s target.
Readonly namespace
Namespace of the URL target (the code of the workspace that the app belongs to).
Methods
addChild
The method allows you to add a child org chart item for the current item.
Parameters
item: OrganisationStructureItem
Returns void
fetch
Request complete data of a reference object.
Returns Promise<OrganisationStructureItem>
find
The method allows you to search among items in a tree with the current item at the root.
This returns the first item that satisfies the predicate or
undefined
if no such items are found.Parameters
predicate: function
Parameters
item: OrganisationStructureItem
Returns boolean
Returns OrganisationStructureItem | undefined
getChildren
The method allows you to get child items of the current item.
const children = someItem.getChildren();
If the item has no child items, the method returns an empty array.
Returns OrganisationStructureItem[]
getParent
The method allows you to get the parent org chart item for the current item.
const parent = someItem.getParent();
If the item has no parent, the method will return “undefined”.
Returns OrganisationStructureItem | undefined
isDepartment
The method returns
true
if the item is a department andfalse
if it isn’ t.const item = tree.getRoot().find(i => i.data.name === 'Managers'); if (item && item.isDepartment()) { // `item` is a department }
Returns boolean
isGroup
The method returns
true
if the item is a group andfalse
if it isn’t.const item = tree.getRoot().find(i => i.data.name === 'Managers'); if (item && item.isGroup()) { // `item` is a group }
Returns boolean
isPosition
The method returns
true
if the item is a position andfalse
if it isn’t.const item = tree.getRoot().find(i => i.data.name === 'Managers'); if (item && item.isPosition()) { // `item` is a position }
Returns boolean
moveAfter
The allows you to move an item one position to the right in the org chart.
Items are moved on the same level of the org chart, that is, among child items of the same parent item. This method only affects the way the org chart looks on the editing page.
Returns void
moveBefore
The allows you to move an item one position to the left in the org chart.
Items are moved on the same level of the org chart, that is, among child items of the same parent item. This method only affects the way the org chart is displayed on the editing page.
Returns void
moveToParent
The method allows you to make the current item a child item to the specified item.
Parameters
parent: OrganisationStructureItem
Returns void
normalize
Delete duplicate data in arrays.
The method deletes duplicates in fields that store arrays of links to system objects (users, files, app items, or documents). For example, you can call this method after bulk editing data within an object.
const app1 = await Context.data.app1.fetch(); const app2 = await Context.data.app2 .fetch(); app1.data.executors.push(app2.data.executors); app1.normalize(); // Now we need to go over the elements in the new array app1.data.executors .forEach( ... );
Returns void
removeChild
The method is used to delete one or more child items of the current item.
Parameters
item: OrganisationStructureItem | OrganisationStructureItem[]
Returns void
Properties
Methods