- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 12:37 AM - edited 03-20-2024 12:39 AM
Hi,
I have a field called "Time SVC Restored" so If "Time SVC Restored" field is empty when state is resolved, then "Time SVC Restored" field should update with resolve field in incident form, How to achive.
Can you please help on this. It willl be helpful.
Thanks in Advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 01:10 AM
Hi @mania
Here’s how you can set up the Business Rule:
1. Navigate to System Definition > Business Rules and click on New to create a new Business Rule.
2. Fill out the fields for the new Business Rule as follows:
- Name: Give your Business Rule an intuitive name, such as “Auto Populate Store Date on Resolution”.
- Table: Select Incident [incident] from the dropdown. This specifies that the Business Rule applies to the Incident table.
- Advanced: Check the box to enable advanced scripting.
- When to run:
- When: Select “after” Update.
(function executeRule(current, previous /*null when async*/) {
if (current.state == '6' && !current.u_time_svc_restored) { // Assuming ‘6’ is the state value for Resolved and ‘u_store_date’ is the API name of your custom field
current.u_time_svc_restored = current.resolved_at; // Assuming ‘resolved_at’ is the field storing resolution date and time
current.update(); // Saves the record with the updated ‘store date’
}
})(current, previous);
Please replace the "Time SVC Restore" backend name with the actual name of your field and Save the Business Rule.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help us a lot.
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 01:10 AM
Hi @mania
Here’s how you can set up the Business Rule:
1. Navigate to System Definition > Business Rules and click on New to create a new Business Rule.
2. Fill out the fields for the new Business Rule as follows:
- Name: Give your Business Rule an intuitive name, such as “Auto Populate Store Date on Resolution”.
- Table: Select Incident [incident] from the dropdown. This specifies that the Business Rule applies to the Incident table.
- Advanced: Check the box to enable advanced scripting.
- When to run:
- When: Select “after” Update.
(function executeRule(current, previous /*null when async*/) {
if (current.state == '6' && !current.u_time_svc_restored) { // Assuming ‘6’ is the state value for Resolved and ‘u_store_date’ is the API name of your custom field
current.u_time_svc_restored = current.resolved_at; // Assuming ‘resolved_at’ is the field storing resolution date and time
current.update(); // Saves the record with the updated ‘store date’
}
})(current, previous);
Please replace the "Time SVC Restore" backend name with the actual name of your field and Save the Business Rule.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help us a lot.
Thanks & Regards
Deepak Sharma