Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

need help on uccx script

I just started working on a script on UCCX, and the office I'm writing the script for has the hours of 7:00am to 4:30pm M-F. However, on the first Wednesday of every month, their hours are 7:00am to 12:00pm. Is there any way I can write an *if, then* script to show this?

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

need help on uccx script

Hi Eileen.

You can calculate it direct through a boolean variable in the script, or you can call an external XML.

I found esier to calculate it as follows

Define a bolean variable eg. called FirstWednesday

Than add a "SET" step in your script

Set FirstWednesday = {

        java.util.Calendar calendar = new java.util.GregorianCalendar();

        calendar.setTime(new java.util.Date());

        if (calendar.get(java.util.Calendar.DAY_OF_WEEK)  == java.util.Calendar.WEDNESDAY && (

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 1

                )

        ) {

            return true;

        } else {

               return false;

        }

}

The value FirstWednesday will return true or false and , with this value, you can apply an if step setting the right time

HTH

Regards

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"
2 REPLIES

need help on uccx script

Hi Eileen.

You can calculate it direct through a boolean variable in the script, or you can call an external XML.

I found esier to calculate it as follows

Define a bolean variable eg. called FirstWednesday

Than add a "SET" step in your script

Set FirstWednesday = {

        java.util.Calendar calendar = new java.util.GregorianCalendar();

        calendar.setTime(new java.util.Date());

        if (calendar.get(java.util.Calendar.DAY_OF_WEEK)  == java.util.Calendar.WEDNESDAY && (

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 1

                )

        ) {

            return true;

        } else {

               return false;

        }

}

The value FirstWednesday will return true or false and , with this value, you can apply an if step setting the right time

HTH

Regards

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"
New Member

need help on uccx script

Carlo,

Thank you so much! I think it actually worked; it wasn't accepting anything else I was trying. It doesn't go into effect for a few weeks, but I'm crossing my fingers!

282
Views
5
Helpful
2
Replies