Auto-Populate Current username and email-id in worknotes

ujjwal_5181
Tera Contributor

Hi All,

I am working on a requirement wherein When anyone updates the worknotes in incident form then along with the notes username and mail id should also be auto-populated in the same worknotes field.

Please help me with this.

Thanks

 

 

6 REPLIES 6

SC15
Tera Guru

@ujjwal_5181-

 

Try updating your BR as below:

 

(function executeRule(current, previous /*null when async*/) {

var agent_email = "[code] <a href='mailto:'" + gs.getuser().getemail() + ">" + gs.getuser().getemail() + "</a>[/code]";
var notes = current.getvalue("work_notes");

current.work_notes = gs.getUserDisplayName() + "\n" + agent_email + "\n";

})(current, previous);

 

I tried it and the code does not duplicates your work notes.

 

Please mark my response as helpful and as a solution, after you try it successfully.

ujjwal_5181
Tera Contributor

I have tried this It will not give duplicate but It will create two separate record in sys_journal_field table. I want one single record to be created If I post my worknotes. If it is possible please tell me how can I achieve it.