Survey Trigger Condition

Ramya SL
Tera Contributor

Hi,

My below trigger condition is not working.

My requirement is I have to trigger a CSAT survey for the newly onboarded users on condition who completed 5 days from joining, Short description and ticket state is closed complete.
This trigger condition should run every day and should trigger the survey only once for a one user.

 


Screenshot (14).pngScreenshot (13).pngScreenshot (12).pngScreenshot (11).png

2 REPLIES 2

Tim Deniston
Mega Sage
Mega Sage

The Trigger Condition is only evaluated when the request is updated (it's a business rule, which you can see in the "Business rule" field on the Trigger Condition). So, if your REQ is not updated on just the right day, the conditions will not be met and the survey will not trigger. 

 

If you are using Employee Onboarding & Transitions/Lifecycle Events, you can set this up in an activity set. Otherwise, you will likely need to create a scheduled job that will create the survey via JavaScript. 

Tai Vu
Kilo Patron
Kilo Patron

Hi @Ramya SL  

After you define a Trigger Condition, it will auto generate a business rule. And business rule is executed based on database actions.

Timi_0-1708316033507.png

 

In your case, you can try to build a survey with scheduled period Only Once, and a schedule job runs on a daily basis which will execute the below script.

(new SNC.AssessmentCreation()).createAssessments('<your_survey_sys_id>');

 

You also need to define the Recipient List to collect the users sys_id based on your condition in the Request [sc_request] table. Then just execute the below script before generate the Survey.

var grRecipient = new GlideRecord('sn_publications_recipients_list');
grRecipient.get('<your_recipient_list_sys_id');
new sn_publications.RecipientsListApi().refreshRecepientList(grRecipient);

 

Cheers,

Tai Vu