Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

TASK Creation Emails Not triggering for roles

stalluri
Regular Contributor II
Regular Contributor II

Hello Team,

I have few roles and Once the Role is approved it is creating Tasks for disconnected systems.

 

tempsnip.jpg

I don't see any emails getting triggered for Tasks created.

Can you help me, if there is any place I need to include the Email template to trigger on task create for Roles.

I have added the template in Endpoint and Global Config

stalluri_0-1691511866092.png

 


Thanks,

Sam.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.
7 REPLIES 7

dgandhi
All-Star
All-Star

Is that entitlement part of the role and endpoint where you have attached the email template?

Also did you specify the task type as "Add Access" at endpoint level

dgandhi_0-1691513336265.png

 

 

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

stalluri
Regular Contributor II
Regular Contributor II

@dgandhi 

I have added the it already.

stalluri_0-1691514032469.png

Still I am not receiving any emails only for Roles.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

This will not send email for the role but for the add access task created for the entitlement (which is part of the endpoint where you attached the email template)

If it is not sending email, please check the logs , maybe there is some error in the binding variable of the email template.

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

stalluri
Regular Contributor II
Regular Contributor II

 DEBUG services.ArsTaskService - Error in sendTaskCreateEmail : \n",
"log":"java.lang.NullPointerException: Cannot invoke method format() on null object\n"

I am seeing the above error.
@dgandhi 


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

This seems to be an issue with the binding variable. please try one simple email template without any binding variables to confirm that the functionality is working as expected and email is triggered on task creation.

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Does email template attached in workflow at Grant Access block.

One of the binding variable is not working during role request.

You can find available binding variables in email template using below script

${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

stalluri
Regular Contributor II
Regular Contributor II

@rushikeshvartak @dgandhi 
I am using the dynamic Attributes Binding variables in Entitlements level.

In roles those dynamic Attributes binding values are causing the issue.

1. Is there any way we can use different email templates for Roles and entitlements.
 If YES. How can we differentiate it?

Current Errors:
DEBUG services.ArsTaskService - Error in sendTaskCreateEmail : \n","stream":"stdout","time":"2023-08-09T14:22:15.947149477Z"}"
"{"log":"org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.saviynt.ecm.workflow.Request_Access.request_access_attrss, no session or session was closed\n"

-----------------------------------------------------------------------------------------------------------------------------------

DEBUG security.RestTokenGeneratorService - userNameCookie populated\n","stream":"stdout","time":"2023-08-09T14:22:15.646960814Z"}"
DEBUG log.LogUserLoginsService - UserLogins login for loginkey=78981 userid=2522comment=token\n","stream":"stdout","time":"2023-08-09T14:22:15.685257749Z"}"
DEBUG ws.JbpmapiController - Enter dosignoff\n","stream":"stdout","time":"2023-08-09T14:22:15.697453665Z"}"
ERROR services.WorkflowService - Inside the getXtaskId for jbpmexecutionid Role Owner WorkFlow.532605.1.532655.Role Owner.532657\n","stream":"stdout","time":"2023-08-09T14:22:15.698431675Z"}"
ERROR services.WorkflowService - singletaskstoPerform size ::: 1\n","stream":"stdout","time":"2023-08-09T14:22:15.726146385Z"}"
ERROR services.WorkflowService - returnString 532659___6770c22b-9a20-42e7-abdd-bbecf6991940\n","stream":"stdout","time":"2023-08-09T14:22:15.726163651Z"}"
ERROR ws.JbpmapiService - dosignoff input params :::: [xtaskid:532659___6770c22b-9a20-42e7-abdd-bbecf6991940, xAccessApproverKey:7459, xstatus:2, approvedByUser:2522]\n","stream":"stdout","time":"2023-08-09T14:22:15.726172492Z"}"
DEBUG services.WorkflowService - roletype: 4\n","stream":"stdout","time":"2023-08-09T14:22:15.730128232Z"}"


Updated Email template:

${request.comments ?: 'Null'}
uses the ternary operator (?:) to check if request.comments is not null. If it has a value, it will be displayed; otherwise, it will display "Null"
Same with all binding variables at entitlement and Account level is working. Still failing at role request level.

<div>|Start Date|*${user.startdate ? user.startdate.format("MM-dd-yyyy HH:mm:ss") + ' UTC' : 'Null'}*|</div>
<div>|Employee Type|*${user.employeeType ?: 'Null'}*|</div>
<div>|Job Title|*${user.title ?: 'Null'}*|</div>
<div>|Comments|*${request.comments ?: 'Null'}*|<br>|Locale|*${def cp4=task?.requestAccessKey?.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('location')}.collect{it.attributeValue}.join('###')} ?: 'Null'}*|<br>|Urgency|*${def cp1=task?.requestAccessKey?.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('Urgency')}.collect{it.attributeValue}.join('###')} ?: 'Null'}*|</div>


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.