Update Short Description When Work Notes Are Updated

ZubairQ
Mega Contributor

Requirement

Whenever Work Notes are updated on an Incident, automatically append the user details to the Short Description field.

 

Solution: After Business Rule

We can achieve this using an After Business Rule on the Incident table that triggers whenever the work_notes field changes.

 

Condition:  current.work_notes.changes()

 

If(!current.work_notes.changes()){

return;

}

var usr = gs.getUserDisplayName();

current.short_description = current.short_description +“ ”+ “updated by ” + usr;

 

Script Explanation

  • current.work_notes.changes()
    Checks whether the Work Notes field was modified in the current update.

  • gs.getUserDisplayName()
    Retrieves the display name of the currently logged-in user.

  • current.short_description
    Appends the user information to the existing short description.

 

 

Conclusion

This approach provides a simple way to reflect user activity directly in the Incident short description without additional fields or tables.

1 ACCEPTED SOLUTION

PrashantLearnIT
Tera Sage

Hi @ZubairQ 

 

This is not completely feasible, imagine there are 10 times Work Notes updated, short description field will not have that size to save these lot of details. I suggest you can try this on Description rather than short description field.

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

View solution in original post

3 REPLIES 3

PrashantLearnIT
Tera Sage

Hi @ZubairQ 

 

This is not completely feasible, imagine there are 10 times Work Notes updated, short description field will not have that size to save these lot of details. I suggest you can try this on Description rather than short description field.

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

@PrashantLearnIT  Yes, you’re absolutely right. This approach would be suitable only for limited updates to the Short Description and may not be ideal for frequent changes.

GlideFather
Tera Patron

Hi @ZubairQ,

 

why would you do that in the first place? Sorry for telling it but this scenario is just nonsense.

 

If some details are stored in Work notes, then it's visible only to technical stuff (assignment group, agents, managers, admins) and it's hidden from end users on purpose... copying it from WN to ANY other field is just wrong.

 

Also, the short description field (with limited character length) shall be as concise as possible as it serves for easier identification and categorisation... that would lead to inconsistency and imagine an incident that is WIP has suddenly changed its short description... there is no benefit from this, just chaos. sorry...

 

 

_____
No AI was used in the writing of this post. Pure #GlideFather only