Very odd, I just confirmed the same thing. It seems that the nested_target_type only works for the board and category values and not for conversation, label or message and possibly others.
I also tried filtering for a specific label ID and struck out as well:
Query:
SELECT * FROM subscriptions WHERE target.id = 'Downloads' AND target.type = 'label'
Response:
{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "subscriptions",
"list_item_type" : "subscription",
"size" : 0,
"items" : [ ]
},
"metadata" : { }
}
SuzieH, are you and the Engineering Team already aware of this limitation? Any suggestions for filtering only for label subscriptions another way with LiQL?
Akenefick, where are you using the LiQL response, is it in some FreeMarker code or through a script or something? I ask because you could always filter the query results after the fact...although I could see where this would almost certainly result in much larger query results than you'd want.
FreeMarker Example:
<#-- Import dependencies -->
<#import 'theme-lib.common-functions' as commonUtils />
<#-- Perform the LiQL query -->
<#assign query = "SELECT subscriber,target FROM subscriptions WHERE target.id = 'my-awesome-forum' AND target.type = 'board' AND include_nested = true" />
<#assign subscriptions = commonUtils.executeLiQLQuery(query, false, true)![] />
<#-- Initialize a sequence to store the results -->
<#assign labelSubscriptions = [] />
<#-- Loop through the data -->
<#list subscriptions as subscription>
<#if subscription.target.type == 'label'>
<#assign subData = {
"label": (subscription.target.id)!"UNKNOWN_LABEL",
"user": (subscription.subscriber.login)!"UNKNOWN_LOGIN"
} />
<#assign labelSubscriptions += [subData] />
</#if>
</#list>
(Disclaimer: I wrote the code above from memory without testing so it should be correct and free from syntax errors. 🙂)
EDIT: Adjusted the executeLiQLQuery function call to run as admin per your latest comment.