Auto update the time stamp when the assignment group is selected in Incident Form

Bhavani13
Tera Contributor

Hi 

Can we have the time stamp auto updated in the new field (Date) when the ticket has been moved to a particular group.

Ex: If the ticket has been assigned to B group from A group, the time stamp when the ticket has been assigned to B group should be auto filled in the new Date field.

 

Can anyone suggest how can I achieve this.

 

Thanks in Advance!

 

Thanks,

Bhavani 

 

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Bhavani13 

what happens if again it changes from B to C?

Will you be using same field to keep track of when was the last group changed?

what's your business requirement here?

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

Hi @Ankur Bawiskar 

 

If the priority is critical of the incident is critical, the incident will be assigned to the B group, it will not be re-assigned to another group. The ticket will be closed in B group itself.

 

Regards, 

Bhavani

 

@Bhavani13 

then do this

1) create before update BR on your table with proper condition

current.groupField == 'A' && previous.groupField == 'B'

Script

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

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

})(current, previous);

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

Sohail Khilji
Kilo Patron
Kilo Patron

HI @Bhavani13,

 

You can do this with onChange Client script:

 

field: Assignement group.

Type : OnChange.

 

Script :

if(newValue == 'your desired group goes here') {
g_form.setValue('column_name', new Date());
}

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect