SLA timezone source

amit71
Tera Contributor

I have a scenario where the timezone source field  is selected as the caller's timezone, but the timezone field is empty in user's profile, then how the SLA will run?

amit71_1-1686564783983.png

 

 

1 ACCEPTED SOLUTION

Ahmmed Ali
Mega Sage

Hello @amit71 

 

If the timezone is empty, then system timezone will be used. you can find system timezone in system property glide.sys.default.tz

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

2 REPLIES 2

Ahmmed Ali
Mega Sage

Hello @amit71 

 

If the timezone is empty, then system timezone will be used. you can find system timezone in system property glide.sys.default.tz

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Riya Verma
Kilo Sage
Kilo Sage

Hi @amit71 ,

Hope you are doing great.

 

The system timezone is typically set based on the server's location or the organization's standard timezone.

If the timezone field is empty, you would need to handle this situation by either automatically populating the timezone field based on the caller's timezone selection or by prompting the user to provide their timezone information

 

Reference code snippet that demonstrates how you can populate the timezone field in the user's profile based on their location or other relevant criteria:

// Business rule script to populate timezone field in user's profile
(function executeRule(current) {
  var user = new GlideUser(current.user.toString());
  
  if (current.timezone.nil()) {
    // Logic to determine the user's timezone based on their location or other criteria
    var timezone = determineUserTimezone(user.getPreference('location'));

    if (timezone) {
      // Set the timezone field in the user's profile
      user.setTimeZone(timezone);
      user.update();
    }
  }
})(current);

function determineUserTimezone(location) {
  // Custom logic to determine the user's timezone based on their location
  // Implement your own code here to map locations to timezones
}
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma