Need issue transaction if status is closed need to capture closing time automatically

Hi Friends,
I renamed Issue doctype as “Ticket” in that i need if status is closed it should capture closed time automatically like fields “created time and created date”


Thanks in Advance

Hi @sathya_raj,

Please apply the client script for that.

frappe.ui.form.on('Issue', {
    before_save: function(frm) {
        if (frm.doc.status === 'Closed') {
            frm.set_value('custom_ending_date', frappe.datetime.get_today());
            frm.set_value('custom_ending_time', frappe.datetime.now_time());
        }
    }
});

Output:

1 Like

Thank you so much NCP
Another thing if i enter the internal comments it should replicate in timestamp need to change eg:just now if an internal comment is updated

How it triggers, doesn’t too much idea, but you can try it.