Body
The ItemUpdates Table contains each top-level feed item (not feed item replies) in the system.
Query Example
You may use the following example as a starter template.
Please note that the below example does not cover every possible column to select, join, filter, or order by. You may need to modify this query to suit your needs. Refer to the related Getting Started Guide for Database Queries article for how to identify your @BEIDInt or @BEID values (tenant ID).
Select
Top 10
iu.IU_ID,
iu.IU_Title,
iu.IU_Body,
iu.IU_CreatedByUID,
iu.IU_DateCreated,
iu.IU_IsPrivate,
iu.IU_IsCommunication,
iu.IU_AppID,
iu.IU_ProjectID,
iu.IU_ComponentID,
iu.IU_ComponentName,
iu.IU_ItemID,
iu.IU_PlanID,
iu.IU_UpdateTypeID,
iut.IUT_Name As ItemUpdateTypeName,
iu.IU_NotifiedList,
iu.IU_LikesCount
/* Add or change selected columns as necessary. */
From
dbo.ItemUpdates iu With (NOLOCK)
Inner Join dbo.ItemUpdateTypes iut With (NOLOCK) On iu.IU_UpdateTypeID = iut.IUT_ID
Where
iu.IU_BEID = @BEID
/* To filter on project ID, use the below line. */
-- And iu.IU_ProjectID = PROJECT_ID_HERE
/* To filter on application ID (tickets, assets), use the below line. */
-- And iu.IU_AppID = APPLICATION_ID_HERE
/* To filter on ticket ID, use the below lines. */
-- And iu.IU_ComponentID = 9
-- And iu.IU_ItemID = TICKET_ID_HERE
To filter most types of feed data to specific items, such as tickets and project issues, you will need to use a combination of both the IU_ComponentID and IU_ItemID columns.
IU_ComponentID determines what type of thing an item is. This column aligns with values from the Components table. Tickets use the value 9, ticket tasks use the value 25, project issues use the value 3 and so on.
IU_ItemID matches to the ID of the specific item. This is where you filter to specific ticket/issue/ticket task IDs.
When filtering for ticket tasks, in addition to IU_ComponentID = 25, you should also filter on IU_PlanID matching the ID of the parent ticket ID (ex: IU_PlanID = TICKET_ID_HERE).