Checkbox variable is not showing in the task and can't close out task since it's mandatory

John Vo1
Tera Guru

I'm unable to close out task since the checkbox variable is not visible and it's mandatory..  How can I close it out?

 

JohnVo1_0-1732109277210.png

 

8 REPLIES 8

Gaspy
Tera Contributor

Are you looking for a one off solution to help close this specific task or are you looking for a solution to always check this box?

 

Yes one off solution.  

 

Gaspy
Tera Contributor

Since it's a one off solution for this specific record, you can go into a background script (System Definition > Scripts-Background) and input the following code. You'll need the sys_id of the specific catalog task record, as well as the variable name that you're looking to update to "true"

 

 

var gr = new GlideRecord("sc_task");
gr.get("sys_id of the record you're on");
gr.query();



if(gr.next()){
	gr.setValue("variable_name", true);
	gr.update();
}

 

 

 

That didn't work because the checkbox is not there on the variable listed on the task form.  But it's a variable that is active under variables on the catalog item.