Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Ramen on October 10, 2014, 11:54:58 PM

Title: NOT READY STATE CC PULSE
Post by: Ramen on October 10, 2014, 11:54:58 PM
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
Title: Re: NOT READY STATE CC PULSE
Post by: Ramen on October 12, 2014, 07:49:17 PM
Team,

Need your help :(


Thanks,
RAm
Title: Re: NOT READY STATE CC PULSE
Post by: Kubig on October 13, 2014, 12:43:25 PM
What do you want to achieve? From your post is not clear.
Title: Re: NOT READY STATE CC PULSE
Post by: Ramen on October 21, 2014, 06:35:45 PM
I am trying to display the notready reason for the current state but I am not able to achieve it.

Thanks,
Ram
Title: Re: NOT READY STATE CC PULSE
Post by: kbreboot on November 12, 2014, 06:22:51 AM
Did you resolve your problem?
Title: Re: NOT READY STATE CC PULSE
Post by: dtissona on February 23, 2020, 07:16:13 AM
[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.