How to make Record Producer Variables editable on a ticket form

ppp4
Tera Contributor

When a ticket is submitted using a record producer, Record producer variables will be Read only on the ticket Form.

 

I want these variables to be editable for the users who are part of the current Assignment Group.Please suggest.

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@ppp4 Please implement the following client script on your task record. This will make the variable editor editable.

// Create a Client Script on a table (e.g., incident) and paste this script
// Uncheck (set to false) the "isolate script" checkbox (not available by default)
// To add the isolate script checkbox to the form, configure form layout to add the checkbox
function onLoad() { 
  $("variable_map").querySelectorAll("item").forEach(function(item){
    var variable = item.getAttribute("qname"); 
    g_form.setReadOnly("variables."+ variable, false); 
  }); 
}

Hope this helps. 

Thank you for checking this @Sandeep Rajput ,

 

We actually have a separate Variable editor (UI Macro) for the Module and it has been called in the UI Formatter and the same has been added to the Form. 
Please help me with the logic/evaluation expression (in UI Macro XML) to make the variables editable only if the logged in user is part of the current assignment group. 
<j2:set var="jvar_questionset_read_only" value="true" />