- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 02:32 PM
I have create a record producer for change_request.
In this I am also creating change task for this change request.
So here I want to display all the variables in the record producer in change task description field like " <variable name1 >: <variable Value1>, <variable name2>: <variable Value3>}"
I tried some script by querying from "question_answer" table to get the variable details but It is not giving the variables.
Is there any way to loop all the variables.
Thanks In advance..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2015 04:50 PM
try this:
var gr = new GlideRecord('question_answer');
gr.addQuery('table_sys_id', '1116a6870f0a020062b6e64be1050ec6'); //sys_id of record in question
gr.query();
while (gr.next()) {
if (gr.value) { //exclude questions with empty values
gs.print(gr.question.getDisplayValue() + ": " + gr.value); //display question and answer
}
}
should return something like:
*** Script: Please describe your issue below: user entered description
*** Script: Open on behalf of this user: 7839639120196100636f41ee6e8383d6
*** Script: Short description (Subject Line): user entered short description
will take a bit more work if you have referenced values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 11:44 AM
values for ritm variables are stored in the ritm object (sc_req_item.variables). the variable name is there as well. if you want the question text, one would need to cross reference the variable name against the item_option_new table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 12:04 PM
Have you tried adding the "Change Variable Editor" to the form?