Documentation

Timeline records

Set of method for handling timeline records

rpa.timeline.*

Method Description Available form version
rpa.timeline.listForItem({typeId: number, itemId: number, start: ?number = 0}) Method returns array of timeline records for item with ID itemId of process with ID itemId, sorted by earliest date of creation (the newest on top). Parameters:
  • typeId - process ID
  • itemId - item ID
  • start - start for pagewise navigation

Example of response

{
    "timeline": [
        {
            "id": 321,
            "typeId": 24,
            "itemId": 10,
            "createdTime": "2020-03-26T20:28:57+02:00",
            "userId": 1,
            "title": "Task completed",
            "description": "",
            "action": "task_complete",
            "isFixed": false,
            "data": {
                "item": {
                    "name": "New name"
                },
                "scope": "task",
                "stageFrom": {
                    "id": 30,
                    "name": "Approved by accountant"
                },
                "stageTo": {
                    "id": 31,
                    "name": "Approved"
                },
                "fields": [
                    {
                        "name": "UF_RPA_24_NAME",
                        "title": "Name"
                    }
                ],
                "task": {
                    "ID": "91",
                    "USER_ID": "1",
                    "WORKFLOW_ID": "5e7cf3e91ef413.27314358",
                    "ACTIVITY": "RpaRequestActivity",
                    "ACTIVITY_NAME": "A79985_79846_49104_50661",
                    "NAME": "Task",
                    "DESCRIPTION": "",
                    "PARAMETERS": {
                        "DOCUMENT_ID": [
                            "rpa",
                            "Bitrix\\Rpa\\Integration\\Bizproc\\Document\\Item",
                            "24:10"
                        ],
                        "TASK_EDIT_URL": "/rpa/task/id/#ID#/",
                        "ACTIONS": [
                            {
                                "color": "3bc8f5",
                                "stageId": "31",
                                "label": "Save"
                            }
                        ],
                        "FIELDS_TO_SHOW": [
                            "UF_RPA_24_NAME",
                            "UF_RPA_24_STRING_MANDATORY"
                        ],
                        "RESPONSIBLE_TYPE": null,
                        "APPROVE_TYPE": null,
                        "FIELDS_TO_SET": [
                            "UF_RPA_24_NAME"
                        ]
                    },
                    "USERS": [
                        1
                    ],
                    "INCOMPLETE_USERS": [
                        
                    ]
                }
            },
            "createdTimestamp": 1585247337000,
            "users": {
                "1": {
                    "id": "1",
                    "name": "Anton",
                    "secondName": "",
                    "lastName": "Gorbylev",
                    "title": null,
                    "workPosition": "",
                    "fullName": "Anton Gorbylev",
                    "link": "/company/personal/user/1/"
                }
            }
        },
    ]
}
  • id - record ID
  • typeId - process ID
  • itemId - item ID
  • createdTime - time record created
  • userId - user ID who initiated action
  • title - record title
  • description - record text content
  • action - action type code
  • isFixed - flag for record to be fixed
  • data - serialized data about completed action and associated entities at the moment of record creation. Can contain different set of data depending on the type of action. Depending on the type of action, can contain set of various data. Main parameters are as follows:
    • item - item data
      • item[name] - item name at the moment of completed action
    • scope - code of action source. It can accept one of the following actions:
      • manual - manually
      • task - when task is completed
      • automation - via automation rule
      • rest - by application
    • stageFrom - data on the source stage at the moment when action is completed
      • id - ID
      • name - name
    • stageTo - data about new stage (when it was modified upon completed action)
    • fields - array of field data which values were modified upon completion of action
      • name - field code
      • title - field title
    • task - task data (when action was completed upon task completion)
  • users - user data that had association to the action
rpa.timeline.updateIsFixed({id: number, isFixed: string}) Method updates record fixed position flag. Parameters:
  • id - record ID
  • isFixed - flag specifying a record fixed's position. When y - record will be fixed, otherwise - it won't be.

Methods returns data on updated timeline record.

{
    "timeline": {
        "id": 322,
        ...
    }
}
rpa.timeline.add({typeId: number, itemId: number, fields: {}}) Method creates new timeline record for the item with ID itemId of process with ID typeId. Parameters:
  • typeId - process ID
  • itemId - item ID
  • fields - record fields.
    • title - record title
    • description - record description (html can be used)

This method allows modifying only the fields title and description

Example of execution

{
    "timeline": {
        "id": 325,
        "typeId": 24,
        "itemId": 10,
        "createdTime": "2020-03-26T21:55:25+02:00",
        "userId": 1,
        "title": "rest update",
        "description": "<h5>small header</h5>",
        "action": false,
        "isFixed": false,
        "data": {
            "scope": "rest"
        },
        "createdTimestamp": 1585252525000,
        "users": {
            "1": {
                "id": "1",
                "name": "Anton",
                "secondName": "",
                "lastName": "",
                "title": null,
                "workPosition": "",
                "fullName": "Anton",
                "link": "/company/personal/user/1/"
            }
        }
    }
}
rpa.timeline.update({id: number, fields: {}}) Method updates timeline record with ID id. Parameters:
  • id - record ID
  • fields - record fields.
    • title - record title
    • description - record description (html can be used)

This method allows modifying only fields title and description

This method allows modifying only those records that were created by the same user and using the application.

rpa.timeline.delete({id: number}) Method deletes a timeline record with ID id. Parameters:
  • id - record ID

This method allows deleting only those records that were created by the same user and using the application.

User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2020, «Bitrix Inc.», 2020