Conditionally Removing Build-in Time Tracking Features of Jira

If you want you can remove build-in time tracking 'Log Work Action', 'Time Tracking Panel', 'Worklog Tab Panel' of Jira using the technique explained here. This removes these features for all users, but sometimes you may want these to be removed by only a subset of users. If you have disabled WorklogPRO for some users and they can't access WorklogPRO's 'Log Work Action', 'Time Tracking Panel' and 'Worklog Tab Panel' and if you also disables build-in time tracking features as explained here these users can't log their time or see time tracking information. So disabling build-in time tracking features global is not an option in this scenario. In that case, you can conditionally remove build-in time tracking features with a Javascript. Go to Administration → System → Announcement banner and add the following script as announcement banner. This script will check availability of WorklogPRO's 'Time Tracking Panel' and if it is available disable build-in time tracking features of Jira. So build-in time tracking features will be only disabled for the users who can access WorklogPRO.


<script type='application/javascript'>
if (typeof(AJS) !== 'Undefined') {
AJS.$(function() {
  try {
    var worklogPROAvailable = AJS.$("#WorklogByUserPanel").length > 0;
    if (worklogPROAvailable) {
      AJS.$("#timetrackingmodule").remove();
      AJS.$("a.issueaction-log-work").remove();
      AJS.$("#worklog-tabpanel").remove();
    }
    AJS.$("div#announcement-banner").remove();
  } catch(e) {AJS.log(e)}
});
}
</script>