How to query work notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 08:47 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 08:56 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 08:59 AM
var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 09:38 AM
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.
