Fix for GlideappVariablePoolQuestionSet is not allowed in scoped applications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 01:13 PM
Hi,
I am a total noob at JS, and I am working with code out of the article below to copy variables from RITM forms to the description field on the REQ form.
https://community.servicenow.com/community?id=community_question&sys_id=fa6fb6a9db58dbc01dcaf3231f961966&view_source=searchResult
I would like to know what my options are to alter the particular line so that it will work in our instance. We are on Kingston. I included the rest of the code below. TIA!
var gr= new GlideRecord("sc_req_item");
gr.addQuery('request',current.sys_id);
gr.query();
var varArr='';
while(gr.next()){
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(gr.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '') {
varArr+=vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue()+'\n';
}
}
}
current.description=varArr;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2019 03:15 PM
Please use the editor so your code looks like this
Also regarding your question, I'd write your own;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 06:18 AM
Thanks, I will try that out. I did notice when I was creating the rule, that it was on the ITSM spoke and not Global. O think that is where the conflict is.