Automatic activity work notes

lynchr02
Tera Contributor

I'm trying to figure out how to add work notes in the activity field when a catalog task has been started from a work flow and assigned to a different assignment group

2 REPLIES 2

Shoheb_IbaaBoss
Tera Guru

Hi,

Try below:

 

  1. Create a Business Rule or Workflow:

    • Business Rule: You can create an "onAfter" business rule on the catalog task table. This rule will trigger after the record has been inserted or updated.
    • Workflow: Alternatively, you can use a workflow with appropriate activities to achieve the same result.
  2. Define the Trigger Conditions:

    • Specify the conditions under which you want the work notes to be added. This might include criteria such as the assignment group being changed or the task being started.
  3. Add Script to Update Work Notes:

    • In the business rule script or workflow activity script, use the ServiceNow GlideRecord API to update the 'work_notes' field in the activity stream.
    • Here's an example of a business rule script:
     
    (function executeRule(current, previous /*null when async*/)
    { if (current.assignment_group.changes() || current.active.changes())
    { // Check if assignment group or active status has changed
    var workNotes = "Catalog task started. Additional information here.";
    current.work_notes = workNotes;
    current.update();
    } })(current, previous);
     

ahefaz1
Mega Sage

@lynchr02 ,

 

Any reason you are not able to add the assignment group field on the catalog form like below:

 

ahefaz1_0-1704809374346.png

 

In case you want to add custom work notes, you can write a business rule.

 

ahefaz1_1-1704809422457.png

	current.work_notes = "Assignment Group has Changed";

Please accept the solution if it solved your query or please mark helpful if this helped.

Thanks,