and more in a single search tool across platforms. Read the announcement here. |
05/17/2023 11:55 PM
Hi all,
I'm currently working on an analytic email where admin account will be receiving a list of failed tasks for a specific endpoint in an email. The analytic is working fine, but the email will work only if the 'Group emails by username' under Global Configurations - Analytics is checked. Would not want this checkbox to be checked as it will affect other emails as well.
If the checkbox is not checked, email will not be sent out and the below error occurs:
It says no such property for 'Tasks', but since it's working fine when the checkbox is checked, I believe there should be no problem fetching the data from analytic to email, but now the exact same code is not working if I uncheck the box.
Does anyone know how can I list all the failed tasks in one email (without having the 'Group emails by username' checkbox checked) instead of sending out one email for each of the tasks?
Please find below the table configured in email template:
<table>
<tr>
<th>Task ID</th>
<th>Username</th>
<th>Error</th>
</tr>
<%int count=Integer.parseInt("${ANALYTICSDATA.Tasks.size()}"); for(int i=0;i<count;i=i+1){%>
<tr>
<td>${ANALYTICSDATAMAP.'Tasks'[i]}</td>
<td>${ANALYTICSDATAMAP.'CompanyUsername'[i]}</td>
<td>${ANALYTICSDATAMAP.'LatestError'[i]}</td>
</tr><%}%>
</table>
Thanks and regards,
Suet Yie
05/21/2023 11:29 PM
Please share the analytics query used here also.
05/22/2023 12:10 AM
In your analytics query if you use username and email columns of the users to whom the emails needs to be sent the it will be sent without checking the config you mentioned.
In the email template you should use ${userEmail} as To field value.
05/22/2023 12:11 AM
sample query:
select a.TASKKEY as 'Tasks',a.ACCOUNTNAME as 'CompanyUsername' ,a.PROVISIONINGCOMMENTS as 'LatestError',
'abc@xyz.com' as 'email','abcd' as 'username'
from arstasks a ;
05/23/2023 08:39 PM
Hi @nimitdave,
Thanks for the reply. This is my current approach and it's not working. The error log attached is what I got when running this query, here's my query:
Select a.TASKKEY as 'Tasks', a.taskdate as 'TaskDate', u.SYSTEMUSERNAME as 'CompanyUsername', a.ACCOUNTNAME as 'ApplicationAccount', a.accountkey as acctKey, e.endpointname as 'Endpoint', ev.entitlement_value as 'EntitlementValue', a.comments as 'TaskComments', a.source as 'Source', 'qwer' as 'username', 'qwer@xyz.com' as email,
Regards,
Suet Yie
05/22/2023 05:27 AM
Store application owner as Resource owner or endpoint certifier and pull that owner name as username column that should resolve your issue
05/23/2023 08:47 PM
Hi @rushikeshvartak,
Thanks for the reply, may I know is there any sample query on this?
I've stored the application owner as resource owner and stated the owner name as username column on analytic query but still getting the same error, 'No such property: Tasks'.
Regards,
Suet Yie