Servicely Administration
Scripting
Journal API
3 min
to use this functionality, you need to be on version 1 10 or later the journal api provide easy access to journal entries, without the need to do complex queries to the underlying table this provides you the ability to get all the journal entries and the details within it (such as who made it and what date time) journal field api function returns description array of journal entry objects returns the entire activity of a journal field (including the date time, user and more)example table('incident', 'inc0000005') clientjournal activity() array of journal entry objects example returns the first third entries table('incident', 'inc0000005') clientjournal activity(3) journal entry apis above return journal entries for a given field, the following methods are available to get data from a single entry function returns description string returns the display value of the user that created the entry, usually ${firstname} ${lastname} user record returns the actual table record of the user that created the journal entry user record returns the actual table record of the user that updated the journal entry for convenience, should always be the same as createdby() datetime returns when the journal entry was created datetime returns when the journal entry was updated for convenience, should always be the same as createdon() string (html) the journal html entry as it is stored string (text) the journal entry with html escaped examples table('incident','inc0000005') clientjournal activity(1); // \[{author=admin administrator, createdon=2024 05 21t19 10 44 966+10 00, value=\<p>hello world!\</p>}] table('incident','inc0000005') clientjournal activity(2)\[0] author(); // admin administrator table('incident','inc0000005') clientjournal activity(2)\[0] html(); \<p>hello world!\</p> table('incident','inc0000005') clientjournal activity(2)\[0] text(); hello world!