- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 02:53 AM
I want to show an info message when an incident is opened. Info message has to contain the Business time left of that particular incident.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 05:49 AM - edited ‎03-06-2023 05:51 AM
Hi Sharan
You can create a display business rule as shown below:
- Table: Incident
- When: display
- Filter conditions: As you require. I added some state requirements in the example below.
With something similar to the below in the "Advanced" tab
(function executeRule(current, previous /*null when async*/) {
var sla_gr = new GlideRecord('task_sla');
sla_gr.task = current.sys_id;
sla_gr.state = 'in_progress';
sla_gr.query();
if(sla_gr.next()) {
gs.addInfoMessage('Business time left: ' + sla_gr.business_time_left.getDisplayValue());
}
})(current, previous);
Let me know if this solves your issue, or if you need some clarifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2023 05:49 AM - edited ‎03-06-2023 05:51 AM
Hi Sharan
You can create a display business rule as shown below:
- Table: Incident
- When: display
- Filter conditions: As you require. I added some state requirements in the example below.
With something similar to the below in the "Advanced" tab
(function executeRule(current, previous /*null when async*/) {
var sla_gr = new GlideRecord('task_sla');
sla_gr.task = current.sys_id;
sla_gr.state = 'in_progress';
sla_gr.query();
if(sla_gr.next()) {
gs.addInfoMessage('Business time left: ' + sla_gr.business_time_left.getDisplayValue());
}
})(current, previous);
Let me know if this solves your issue, or if you need some clarifications.