How to query work notes

csorel
Kilo Explorer

Hi Everyone,

I am having trouble with some queries. What I am trying to do is query for when one of my employees enters a work note to update an incident but did not create that incident. I have trying querying   using the "updated by" field but that does not seem to return the results I am looking for. Can anyone help me or point me in the right direction?

Thanks,

Chris

3 REPLIES 3

Mike Allen
Mega Sage

The work notes are stored in the sys_journal_field table.   It also has the element (sys_id of the task).   Maybe you could query that along with the task and return where task.sys_created_by != sys_journal_field.sys_created_by?



Anurag Tripathi
Mega Patron
Mega Patron

var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n'


-Anurag

Victor Ruiz
Tera Guru

I cant take credit for this but here is an old posting I found here that creates a database view and you can report off that database view.



1. Go to database views and create a new database view.
2. Add a view table 'sys_journal_field' with the view fields 'Element','Element_id','Value'. Variable prefix is 'jou'. Check left join to true.
3. Add another view table 'task' with the view fields 'Number','Sys ID'. Variable prefix is 'tsk'. Check left join to true.
4. Add a where clause to the task table 'tsk_sys_id = jou_element_id' (where task sys_id is equal to journal element sys_id).



Report on the new database view.




dbview.png