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.

Add work_notes when affected CI's got deleted

sry
Giga Guru

Hi, could someone help for the below requirement.

we have "Affected CIs" related list which is of table TASK_CI for Change request(change_request). people can add and remove CIs, the requirement is we can't audit if someone delete CIs or Added. we are thinking to put some work_notes at change_request level when someone deletes or add CIs. appreciate if anyone has worked on same scenario or any help.

thanks,

sry

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Write a business rule on task_ci table


When: before delete


Conditions: Task.task type is change request


Script:


var chg= new GlideRecord('change_request');


  chg.get(current.getValue('task'));


  chg.work_notes=current.ci_item.getDisplayValue()+' is no more affected due to this change';


  chg.update();


View solution in original post

13 REPLIES 13

Here's what you need to see History > List (see Viewing a Record's Change History - ServiceNow Wiki😞



2.2.1   Requirements


To view a history list, the following requirements must be met.


  • Auditing: Auditing for the table must be enabled to view a history list.
  • ACL: By default, the List history option is only available to users with the admin user role. To enable this option to non-admins, create a custom ACL rule granting read access to the Record History [sys_history_set] table.

Hi John, i have enabled ADUTI for TASK_CI table and also i have admin role for this instance so i can see history-->list option. But what i am saying even though i have enabled audit i cant see those relation events when CIs are deleted, but i can see worknotes activity for those removed CIs.



thanks,


sry


Here's what I see from History > List (the deletion shown in the red box). Since your Activity Stream is already showing these events, it should meet your requirements; History > List just shows the same information in a different way.


find_real_file.png


hi John, i can see the activity but somehow this activity event is not registering in to the history list. below are my screen shots.



3.png



1.png


2.png



thanks,


sry


they're all there - you just have to hover over the "I" icon (the first blue icon to the left) or click into it to see the same popup in my screenshot.