How are surveys cancelled?

Jake Sadler
Kilo Sage

Hello,

 

Can someone explain how surveys get cancelled? I cannot find a schedule job or workflow that does this.

 

Thanks

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Jsadler19 ,

For those surveys that are still ready to take even after the due date has passed, there is a Cancel Expired Assessments scheduled job that sets the surveys to expired but, by default, it only runs once every 30 days.   You can find the out-of-box scheduled job at https://[instance].service-now.com/nav_to.do?uri=sys_trigger.do?sys_id=e8785d109f233100736af84bc42e7...

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi @Jsadler19 ,

For those surveys that are still ready to take even after the due date has passed, there is a Cancel Expired Assessments scheduled job that sets the surveys to expired but, by default, it only runs once every 30 days.   You can find the out-of-box scheduled job at https://[instance].service-now.com/nav_to.do?uri=sys_trigger.do?sys_id=e8785d109f233100736af84bc42e7...

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Not seeing this scheduler anywhere?

I was not able to find it either. I wound up creating my own scheduled job. Here is the script I used, in case you need a starting point.

 

(function(){
//go clean up surveys and other assessments which are in the state of ready or in progress and their due date is past
var gr = new GlideRecord('asmt_assessment_instance');
gr.addEncodedQuery('due_date<javascript&colon;gs.daysAgoStart(0)^state=ready^ORstate=wip');
gr.query();
while(gr.next()){
gr.state = 'canceled';
gr.update();
}
})();

Search on Scheduled item (sys_trigger.LIST)

 

Name : Cancel Expired Assessments

sysId : e8785d109f233100736af84bc42e70ab

 

This worked for me !