Custom Filed should be updated with latest work notes

ViraajM
Tera Contributor

Hello ,

 

I want to Create a Business Rule on a Ticket table to capture the latest work notes added in a custom field "last update" this is the code I used it's not working 

var latestUpdate = "";
        if (current.u_work_notes.changes()) {
            latestUpdate = current.u_work_notes.getJournalEntry(1);
        }
        current.u_last_updated = latestUpdate;
    }

})(current, previous);


1 ACCEPTED SOLUTION

Hi @ViraajM ,

 

Did you check my response or are you still facing the issue?

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,

Rohit

 

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@ViraajM 

what are the field types for u_work_notes and u_last_updated?

what debugging did you perform?

Is the business rule triggering?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Rohit  Singh
Mega Sage

Hi @ViraajM ,

 

I believe you are trying to get the OOB Work Notes Journal Entry in your custom field. If yes, then you need to change the code as Work Notes field name is incorrect in your code. It should be work_notes not u_work_notes in line number 1 and 2. 

 

Rest your code is fine and make sure your BR trigger is condition is correct i.e. work Notes changes.

 

If my response helped, please mark it helpful and accept the solution so that it benefits future readers.

 

Regards,
Rohit

Hi @ViraajM ,

 

Did you check my response or are you still facing the issue?

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,

Rohit