Auto update the time stamp when the assignment group is selected in Incident Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 04:35 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 04:49 AM
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?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 05:40 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 05:56 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 04:59 AM
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....