How to show change request variable editor on its change task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2016 10:50 AM
Hello,
I can able to display the catalog variables using variable editor in change request. But I can not display the same to its child record(change task). How to show the change request catalog variables to change task form.
Thanks,
Gowthaman.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2016 12:09 PM
You can add the variables in the workflow variable task option. you can add variables what ever you want appear on the task form into right box. That variables will be appear on the task form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2016 04:02 AM
Thanks Rakesh. I have created a new HTML field in task form, By using a business rule I queried "question_answer" table and display the questions through that HTML field. It works for non reference variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2017 01:34 AM
I have the same issue, did anyone find a way to the the "variable editor" (online form from record producer) onto the change task.
I have the form on the change request but also need it on the change task.
I have configured change task to enable usage of the variable editor (ServiceNow KB: Determining whether the Variable Editor is added to a form (KB0538897) )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2017 02:35 AM
Hi Tony,
Please refer the thread Newly created Variable Editor on Change Request and Change Task not showing. I have applied the below logic and it works well. But this can not be used for reference type variables.For reference variables, it will show the sys_id not the value.
var todo = '';
var hrvar = new GlideRecord('question_answer');
hrvar.addQuery('table_sys_id', current.sys_id);
hrvar.setLimit(50); //just for security
hrvar.orderBy('order');
hrvar.query();
while (hrvar.next()){
if (hrvar.question.type != 11 && hrvar.value != ''){
todo += '<tr><td align = "left"><i><b>' + hrvar.question.getDisplayValue() + '</b></i></td><td>: </td><td>' + hrvar.u_custom_value + '</td></tr>';
}
if (hrvar.question.type == 11){
todo += '<tr bgcolor = "#f6f6f6"><td colspan = "3" align ="left"><b></b></td></tr><tr bgcolor = "#f6f6f6"><td colspan = "3" align ="left"><b>' + hrvar.question.getDisplayValue() + '</b></td></tr>';
}
}
var todoFinal = '<table>' + todo + '</table>';
current.u_to_do = todoFinal;
Regards,
GB
