Khoros Community

Honored Contributor Honored Contributor
Honored Contributor

Re: find posts to escalate after 24 hours

Would this do it?

 

<#assign user_id = user.id/>
<#assign tz = restadmin("/users/login/${user_id}/settings/name/config.timezone").value/>
<#assign beforelong = .now?long - (24 * 60 * 60 * 1000)/>
<#assign before = beforelong?number_to_datetime?iso("${tz}")/>
<#assign query = rest("2.0", "/search?q=" + "SELECT id,subject,post_time,view_href FROM messages WHERE depth = 0 AND replies.count(*) = 0 AND conversation.last_post_time <= ${before} ORDER BY conversation.last_post_time DESC LIMIT 5"?url("UTF-8")) />
<#list query.data.items as q>
	<a href="${q.view_href}">${q.subject}</a> - ${q.post_time?datetime}<br/>
</#list>

CM at Spotify
Community Ergo Sum
0 Kudos
Reply
Loading...