TrackStudio Enterprise 3.5
Example 1

To return the day of the week on which an issue was created use the following Task / Custom Field Value script:

Calendar ca = task.getSubmitdate();
ca.setTimeZone(TimeZone.getTimeZone(sc.getTimezone()));
int day = ca.get(Calendar.DAY_OF_WEEK);
switch (day){
     case Calendar.SUNDAY: return "Sunday";
     case Calendar.MONDAY: return "Monday";
     case Calendar.TUESDAY: return "Tuesday";
     case Calendar.WEDNESDAY: return "Wednesday";
     case Calendar.THURSDAY: return "Thursday";
     case Calendar.FRIDAY: return "Friday";
     case Calendar.SATURDAY: return "Saturday";
}
return null;

 

Associated custom field properties:

Property 
Value 
Type 
List 
List of Values 
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday