Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Reporting - displaying specific 'Comments'

Updated: 22 May 2010 | 1 comment
acachero's picture
0 0 Votes
Login to vote

Can someone please provide assistance or guidance in how I can create a report where it displays a specific text within the 'Comments' field?

I've used the Wizard and compiled the SQL below:

SELECT [HD_workitem_current_view].[workitem_number] AS 'Incident Number', [HD_workitem_current_view].[workitem_created_on] AS 'Created On',
[HD_workitem_current_view].[workitem_comment] AS 'Last Comment',
[HD_workitem_current_view].[owned_by_worker_name] AS 'Queue',
[HD_workitem_current_view].[workitem_priority_lookup_value] AS 'Priority', [HD_workitem_current_view].[workitem_urgency_lookup_value] AS 'Severity', [HD_workitem_current_view].[workitem_category_tree_value] AS 'Category', [HD_workitem_current_view].[workitem_due_on] AS 'Due Date',
[HD_workitem_current_view].[workitem_status_lookup_value] AS 'Status' FROM [HD_workitem_current_view] INNER JOIN [HD_workitem_detail_view] ON [HD_workitem_current_view].[workitem_number] = [HD_workitem_detail_view].[workitem_number]
WHERE [HD_workitem_detail_view].[workitem_comment] LIKE '%Latest Update%' AND [HD_workitem_current_view].[workitem_status_lookup_id] < > 600 AND [HD_workitem_current_view].[workitem_type_lookup_id] = 5 ORDER BY [HD_workitem_current_view].[workitem_created_on] ASC

When the SQL is run, it shows ALL incidents which have 'Latest Update' within the comments - that's fine if the last comment had 'Latest Update....' on it.
However, if the 2nd last update was had 'Latest Update' within the comments field but then had 'Assigned to' as the last comment, the output has the 'Assigned to' comments instead.

I hope that I'm making sense and that someone can help me.

discussion Filed Under:

Comments

mboggs's picture
25
Jun
2008
0 Votes 0
Login to vote

difference between views

The workitem_current_view only shows the last iteration of a ticket, where workitem_is_last=1.

All iterations of a ticket are stored in workitem_detail_view. Previous iterations have workitem_is_last=0. There is also a version field which you may be able to use to determine when that particular comment was made.

I would try your query only using the detail view, then you don't need the join.