- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 01:31 PM
I want to get all the variables that are attached to RITM but if value is blank than skip it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 01:35 PM
I have something I already use and it's working fine for me so it should work for you too.
var scReqItem = new GlideRecord("sc_req_item");
scReqItem.addQuery("sys_id", current.sysapproval.toString());
scReqItem.query();
while (scReqItem.next()) {
var varown = new GlideRecord('sc_item_option_mtom');
varown.addQuery("request_item", current.sysapproval.toString());
varown.orderBy("sc_item_option.order");
varown.query();
while (varown.next()) {
var visible = varown.sc_item_option.item_option_new.visible_summary;
var question = GlideappAbstractChoiceListQuestion.getQuestion(varown.sc_item_option.item_option_new);
question.setValue(varown.sc_item_option.value);
if (question.getLabel() != "" && question.getDisplayValue() != "" && visible == true) {
if (question.getType() == 20 || question.getType() == 19)
continue;
template.space(2);
template.print(' ' + question.getLabel() + " = " + question.getDisplayValue() + "\n" + "<br />");
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 01:35 PM
I have something I already use and it's working fine for me so it should work for you too.
var scReqItem = new GlideRecord("sc_req_item");
scReqItem.addQuery("sys_id", current.sysapproval.toString());
scReqItem.query();
while (scReqItem.next()) {
var varown = new GlideRecord('sc_item_option_mtom');
varown.addQuery("request_item", current.sysapproval.toString());
varown.orderBy("sc_item_option.order");
varown.query();
while (varown.next()) {
var visible = varown.sc_item_option.item_option_new.visible_summary;
var question = GlideappAbstractChoiceListQuestion.getQuestion(varown.sc_item_option.item_option_new);
question.setValue(varown.sc_item_option.value);
if (question.getLabel() != "" && question.getDisplayValue() != "" && visible == true) {
if (question.getType() == 20 || question.getType() == 19)
continue;
template.space(2);
template.print(' ' + question.getLabel() + " = " + question.getDisplayValue() + "\n" + "<br />");
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 04:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 05:59 AM
How can I use different language in this?
