- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 08:00 AM
Hello All,
I have Requirement that to hide the UI Action button after business hours of the assignment group.
I created a UI Action button called "Send Reminder".
We need to show this Button based on assignment group Business hours.
Business hours are different for each assignment group, based on their location.
We have users from Worldwide.
Is there any possible way to implement this?
We have a field called Schedule, in that schedule we added the days of the week and timing.
please check the attached screenshot.
this is foe one assignment group, we have one functionality like if a schedule ends with JP, its for Japan, Ru for Russia like that.
Here we need hide that button after 17(5PM) and before 9AM and we need hide for saturday and sunday also.
please check and help us to get this implemented.
@Ankur Bawiskar @SANDEEP28 @Community Alums
Thanks,
Abdul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 10:11 PM
@Abdul333 As you confirmed that SLA name and assignment group name is same then put below code in script include
var IncidentReminder = Class.create();
IncidentReminder.prototype = {
initialize: function() {},
visibilityBasedOnSchedule: function(groupName) {
var grSla = new GlideRecord('contract_sla');
if (grSla.get('name', groupName)) {
var gsSchedule = new GlideSchedule(grSla.getValue('schedule'));
var todayDateTime = new GlideDateTime();
if (gsSchedule.isInSchedule(todayDateTime))
return true;
else
return false;
} else {
return false;
}
},
type: 'IncidentReminder'
};
UI action Condition -
new global.IncidentReminder().visibilityBasedOnSchedule(current.assignment_group.getDisplayValue());
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 10:20 AM
@SANDEEP28, Assignment group and Schedule are not same.
I said SLA name and Assignment group names are same.
So we need to write query based on SLA table to get values from schedule and in schedule having schedule entries.
Could you please update the script and share it to me.
Thanks,
Abdul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 10:11 PM
@Abdul333 As you confirmed that SLA name and assignment group name is same then put below code in script include
var IncidentReminder = Class.create();
IncidentReminder.prototype = {
initialize: function() {},
visibilityBasedOnSchedule: function(groupName) {
var grSla = new GlideRecord('contract_sla');
if (grSla.get('name', groupName)) {
var gsSchedule = new GlideSchedule(grSla.getValue('schedule'));
var todayDateTime = new GlideDateTime();
if (gsSchedule.isInSchedule(todayDateTime))
return true;
else
return false;
} else {
return false;
}
},
type: 'IncidentReminder'
};
UI action Condition -
new global.IncidentReminder().visibilityBasedOnSchedule(current.assignment_group.getDisplayValue());
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 05:43 AM
@SANDEEP28 Its working, Thank you so much.
Could you please let me know if Schedule is having more no.of schedule entries how it will work.
And if a schedule is having child entries with holidays based on their timezone, how should it will work.
in our system having Schedule entries and Child entries.
Schedule entries for weekly bases.
Child entries for all Holidays os the year based on country.
please answer this to me.
Thanks,
Abdul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 06:01 AM
@Abdul333 Not sure about this . You can open new thread for this question and so that others will help you out. Accept the previous answer as it worked for you. It will help others if they come across same requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 09:50 AM
@SANDEEP28 Thank you so much, I accepted the solution.
Here one more point is pending in my requirement, need hide that Reminder button for next two hours. So no member can send a reminder within 2hours. Please help me on this how we can write script for, please share the steps and query.
Thanks,
Abdul