how to trigger event/notification based on the work notes of the sctask

Vinod S Patil
Tera Contributor

Hello Everyone

I have requirement to trigger the notification when work notes updated in sctask  and it should have the below value then only it should trigger.

error message 'file share failed' and it should have incident number.

Please suggest me on this.


@Ankur Bawiskar 
@SANDEEP DUTTA 

1 ACCEPTED SOLUTION

@Vinod S Patil 

I already shared how to check 1 value, enhance the logic to check for other

you can use this to print the work notes in email body, why email script is required?

Advanced notification condition

var worknotes = current.work_notes.getJournalEntry(1);

if(worknotes.indexOf('file share failed') > -1 && worknotes.indexOf('Incident number') > -1){
	answer = true;
}
answer = false;

Email body:

${work_notes}

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

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Vinod S Patil 

Did you check the out-of-the-box (OOTB) notification for Incidents?

You can follow the same example and configure a similar notification for SCTasks.

 

DrAtulGLNG_0-1751536549867.png

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@Vinod S Patil 

you can have notification on sc_task table

Condition: Work Notes Changes

Use Advanced Condition

AnkurBawiskar_0-1751536625524.png

 

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

@Ankur Bawiskar 

Thank you for the reply 🙂
We need to check here both text and incident number. if these both available then only we have to trigger the notification.

file share failed
Incident number (INC)

Above these two details getting updated in sctask from another application when server failed.
one more last question, can you please help with email script to get these two value in notification

 

@Vinod S Patil 

I already shared how to check 1 value, enhance the logic to check for other

you can use this to print the work notes in email body, why email script is required?

Advanced notification condition

var worknotes = current.work_notes.getJournalEntry(1);

if(worknotes.indexOf('file share failed') > -1 && worknotes.indexOf('Incident number') > -1){
	answer = true;
}
answer = false;

Email body:

${work_notes}

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