Potentially for use where tasks are generated outside of workflow:
var grTask=new GlideRecord('sc_task');
if (grTask.get('number', 'SCTASK0011254')){
var keys = [];
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(grTask.request_item);
set.load();
var vs = set.getFlatQuestions();
var description ='';
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
description = description +vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
gs.print(description);
}
Comments
Post a Comment