How to capture last updated date and time for assignment group field value change

Priya151
Kilo Contributor

We have a requirement to show updated date and time whenever the ticket get reassigned to any assignment group. Can any one help us how we can achieve this requirement. We have a column on Incident form as assignment_group and we would like to know the date & time whenever the value of this column is updated.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Are you using some custom field to hold the reassignment date/time.

What if the ticket gets reassigned multiple times to different groups

You can always write before update BR on incident table

Condition: Assignment Group Changes

Script -> Set the current date time in that custom field

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Priya,

Assuming you are having 1 custom date/time field on incident to hold it and assuming this should be set everytime the Group Changes and when it is not empty

Before Update BR on incident table

Condition: Group Changes AND Group is not empty

find_real_file.png

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.dateTimeField = new GlideDateTime();

})(current, previous);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

asifnoor
Kilo Patron

Hi

Write an before update Business rule on incident table

Filter Conditions

Assignment Group changes

Script

var gdt = new GlideDateTime();

current.your_field_name=gdt;

Here is the screenshot for your reference.

find_real_file.png

 

 

find_real_file.png

Mark the comment as a correct answer and also helpful once worked.