[quote author=Ramen link=topic=8551.msg37636#msg37636 date=1412985298]
Team -
I need help in reflecting the current notready state in CC PULSE.
Here's the script I am using.
result.Text = CalculateReason();
function CalculateReason()
{
if (ccpulse.group("NotReadyTimes").statistic("Break")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("Break")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "Break (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("Lunch")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("Lunch")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(Lunch) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("PeerCoaching")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("PeerCoaching")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(PeerCoaching) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("QualityAssurance")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("QualityAssurance")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(QualityAssurance) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("Restroom")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("Restroom")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(Restroom)(" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("SiteMeeting")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("SiteMeeting")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(SiteMeeting) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("SpecialProject")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("SpecialProject")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(SpecialProject) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("SupervisorCoaching")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("SupervisorCoaching")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(SupervisorCoaching) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("SystemOutage")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("SystemOutage")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(SystemOutage) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("TeamMeeting")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("TeamMeeting")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(TeamMeeting) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("Training")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("Training ")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(Training) (" + f + ")";
}
if (ccpulse.group("NotReadyTimes").statistic("Union")>0)
{
var d = ccpulse.group("NotReadyTimes").statistic("Union")
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var f = ((h > 0 ? h + ":" : "") + (m > 0 ? (h > 0 && m < 10 ? "0" : "") + m + ":" : "0:") + (s < 10 ? "0" : "") + s);
return "NotReadyForNextCall(Union) (" + f + ")";
}
return " "
}
however it is not reflecting the real notready state of the agent.
i am thinking becuase I used the total time in the pre defined statistics in CC Pulse Templates, upon reading some posts here I saw someone posted that the current time should be used instead.
appreicate your help.
Thanks,
Ram
[/quote]
Greetings all,
I realize that this is an old thread, but still hoping someone can help. I'm trying to achieve the same thing with Pulse (not ccpulse). I need to display the duration in a each NotReadyForNextCall reason (custom reason codes for break). Currently, if agent is changing the status from one break status to another break status, I need the duration to reset on the display. I see that the above formula achieve this on ccpulse....
Any help will be appreciated.
Thanks.