After the demand assessments are complete, keep the demand in screening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 12:20 PM
Where is the logic that is setting the demand to qualified after the assessments are complete? We want to keep it in screening and manually move to qualify after the scores are reviewed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:00 AM
Hi @Karlie,
I believe this is set by the DemandUtils script include, specifically line 37. It's done as part of the function checkAndUpdateDemandIfAssessmentsComplete.
DemandUtils link: https://<YOUR-INSTANCE>.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=abea62348f72110040f82ab2f0f92314
checkAndUpdateDemandIfAssessmentsComplete : function(instanceSysId) {
var gr = new GlideRecord('asmt_assessment_instance_question');
gr.addQuery('instance', instanceSysId);
gr.query();
if (gr.next()) {
var questionGR = new GlideAggregate('asmt_assessment_instance_question');
questionGR.addQuery('source_id', gr.getValue('source_id'));
questionGR.groupBy('instance');
questionGR.query();
while (questionGR.next()) {
if (!(questionGR.instance.state == 'complete' || questionGR.instance.state == 'canceled'))
return false;
}
// All assessments completed
var demandGR = new GlideRecord('dmn_demand');
if (demandGR.get(gr.getValue('source_id')) && demandGR.state == 3) {
demandGR.state = -4;
demandGR.update();
}
return true;
}
return false;
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 09:58 AM
You've probably heard this kind of feedback a lot, but I'd suggest thinking long and hard before making a change to that script. This is an example of one of ServiceNow's Out of the Box Script Includes, and when changes are made, they have to be re-made every time you upgrade the platform. It's manageable, but lots of small changes of this type can quickly lead to problems engaging with new functionality.
Instead, I'd consider looking at your process; do you actually need to review these records before they go to Qualified? Is it perhaps more beneficial to look at the qualified records (those that have had all the Stakeholder feedback and are ready for consideration) and if any aren't ready for review by your PMO / Demand Board, passing them back to Draft with notes on the extra information required. Then the Demand Manager can add extra stakeholders, review feedback, etc., and resubmit as appropriate.