Multiple update field in workflow

i have create a custom workflow for issue module.
only with single update filed for state. each workflow status change the owner of issue.
now I would like to update multiple field for status.

In addition to updating the owner field, I want to update field “richiesta_ndc” a custom field created in issue customization, for single workflow state. i have create this

number 13 works properly, but number 14 It does not seem to work.
am I doing something wrong?
Or multiple updates are not allowed?

write a script for it. on validate you will get the workflow_state.

e.g.

frappe.ui.form.on('Issue', {
	validate: function(frm) {
		if(frm.doc.workflow_state == "Open") {
			//update your fields here
			frm.doc.field_a = value_a
			frm.doc.field_b = value_b
		}
	}
})

thanks @Sangram,
hi have try with this

frappe.ui.form.on('Issue', {
	validate: function(frm) {
		if(frm.doc.workflow_state == "Verifica Importi") {
			//update your fields here
			frm.doc.richiesta_ndc = 1
		}
	}
})

frappe.ui.form.on('Issue', {
	validate: function(frm) {
		if(frm.doc.workflow_state == "Trattamento NC") {
			//update your fields here
			frm.doc.accettazione_proposta = 1
			frm.doc.accettazione_analisi = 1
		}
	}
}) 

but dosnt work.
value 1 is correct for custom row type check?

@sharpec

Have you tried instead of simply setting 1 the following:

frm.set_value("richiesta_ndc", 1)

as well as

frm.set_value("accettazione_proposta", 1)
frm.set_value("accettazione_analisi", 1)

Maybe it works.

Thank you @ci2016, i have try your suggestion, but none!

I’ve done so many tests, but I still can not get it running with the custom script. I noticed that if there are more items of the same state on the workflow, only the first is applied, the others are ignored. I tried inverting the order, first updated to 1 the custom field and then changed the owner. the flag is put and the owner is not changed.

could be considered a bug?

i think you should refresh the fields after assigning the value, something like:

frm.refresh_field("accettazione_proposta);
frm.refresh_field("accettazione_analisi");