Follow up on Team CRM is that I commented out the iUserId line and added this CurrentChannelID:
// var iUserId = CRM.GetContextInfo("user","user_userid");
CurrentChannelID=eWare.GetContextInfo("channel", "chan_ChannelId");
I then modified the SQL:
var strSQL = "select job__stage, count(*) as t from Job with (nolock) where job__channelid="+CurrentChannelID+" and job__stage <> 'CLOSED' group by job__stage";
However when I view the SQL Log, it's not capturing the selected Team ID, and so the page doesn't display at all - just blank frame:
select job__stage, count(*) as t from Job with (nolock) where job__channelid= and job__stage <> 'CLOSED' group by job__stage
So, so much for my meager efforts...