Group last Activity

We are trying to create a widget that shows the list of Groups and the last activity date / last content updated or created date on that Group. 

which API do we need use to achieve this functionality



corrected
[edited by: Satish Kumar Polampalli at 11:56 AM (GMT 0) on Wed, Jan 27 2021]
Parents
  • We don't currently track this.  I recommend creating an automation that uses the Content.AfterCreate event and lookup the content based on the content type to get the date (as the content record only has the CreateDate) and save it in the groups ExtendedAttributes.

  • Former Member
    +1 Former Member in reply to Brian Dooley

    Hi,

    We also have a possibility to get this by passing group container id in the stories API.

    See the following code snipped to get this done.

    #set($groups = $core_v2_group.List("%{ IncludeAllSubGroups = $core_v2_utility.ParseBool('true'), PageIndex = 0, PageSize = 1000 }"))

    #foreach ( $group in $groups )
    #set ($containerIds = "")
    #set ($containerIds = "$group.ContainerId")
    #set ($query = "%{ SortBy = 'Date', SortOrder = 'Descending', PageSize = 1, ContainerIds = $containerIds }")
    #set($stories = $core_v2_activityStory.List($query))

    #foreach ( $story in $stories )
    #afterall
    $group.Name
    $story.LastUpdate
    #end
    #end

Reply
  • Former Member
    +1 Former Member in reply to Brian Dooley

    Hi,

    We also have a possibility to get this by passing group container id in the stories API.

    See the following code snipped to get this done.

    #set($groups = $core_v2_group.List("%{ IncludeAllSubGroups = $core_v2_utility.ParseBool('true'), PageIndex = 0, PageSize = 1000 }"))

    #foreach ( $group in $groups )
    #set ($containerIds = "")
    #set ($containerIds = "$group.ContainerId")
    #set ($query = "%{ SortBy = 'Date', SortOrder = 'Descending', PageSize = 1, ContainerIds = $containerIds }")
    #set($stories = $core_v2_activityStory.List($query))

    #foreach ( $story in $stories )
    #afterall
    $group.Name
    $story.LastUpdate
    #end
    #end

Children