Issue in Workflow state if-else

I am trying to use cur_frm.set_value(‘field name’,‘value to be set’) in workflow state. Everything is working fine even the value to be set can also be seen on console of my browser. But the value is not being setted. This is my code:

if(customer_type==' Pro' && category=='2'){
  	console.log('value to be set',user)
	cur_frm.set_value('name1',user)
     //	cur_frm.save();
    //  frappe.model.set_value("Sales Invoice", cur_frm.doc.name ,'ra_1',user )

The value in user is being printed. My field type is of link-field of user. Also tried it with frappe.model but its not. One more thing. I am using my code after code’s workflow state changes to Review . Any help will be appreciated.

Got to conclusion that review state isn’t letting me update values. Trying to achieve to set value after workflow state changes to reviewed. But not getting any success for what I am trying to achieve. Any suggestions ??