I want to change all cancelled survey to Ready to take state from backend please
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 11:10 PM
Hi All,
My Exit survey has been automatically cancelled because Assessment duration is 14days now I will increases this from 14 to 90 days. but I want to change all cancelled survey to Ready to take state. from backend please let me know how to do it.
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:34 AM
Hi @keval3
Follow below steps
1)go to Assessment instance table, get all the canclled Assessment number as a query.
2)Execute below script in the background script, line "survey.setWorkflow(false);" opttional - if you want to trigger survey notification if can comment this line and verify Survey trigger notification condition.
var qur ="query copied from assessment instance table"; //ex "metric_type.evaluation_method=survey^state=canceled"
var survey = new GlideRecord("asmt_assessment_instance");
survey.addEncodedQuery(qur);
survey.query();
while(survey.next()){
survey.state="ready" //back to ready state
survey.setWorkflow(false)
survey.update();
}
Hope this helps.