Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to show worknotes added by in email notification

Talari Balateja
Tera Expert

Hi,

 

I want show case worknotes in the notification along with "worknotes added by".

 

I got stucked in worknotes added by.

Table _incident

 

Regards,

Sanju

1 ACCEPTED SOLUTION

.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

View solution in original post

9 REPLIES 9

can you log the values and check what your getting ? I have given the code logic rest its upto you to understand and improve. For further help kindly share the detailed info...

 

 i hope it helps... @Talari Balateja 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji 

 

Now I'm able to get added by but the problem is I'm getting userID not the name

 

Updated Script:

 

var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', current.sys_id);
gr.addQuery('element', 'work_notes');
gr.orderByDesc('sys_created_on');
gr.query();

if (gr.next()){
template.print(gr.sys_created_by.getDisplayValue());
}

try this :

 

template.print(gs.getUser().getUserByID(gr.sys_created_by).getDisplayName());


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

HI @Sohail Khilji 

 

I tried this before it's showing blank.

 

TalariBalateja_0-1707907874339.png

 

.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect