Skip to main content

Technical Scenario

  1. Logic for the TimeTracking Import is pulled to ways:
    1. manually from CLI
    2. via CRON
  2. In both cases, the Application pulls a single point entry  -  app/Console/Commands/LogTime.php
  3. Application authenticates in Harvest using REST API V2
  4. Application fetches all Users with Development role (can be configured) - \App\Model\Harvest::getUsersIdsByRole()
  5. For each User-Developer Application fetches the Time Entries for the specific Date (it is a param for CLI. Default - previous day) - \App\Model\Harvest::getTimeLogs()
  6. To fetch the Time Entry the Application check that it has a note with IssueId
    1.  preg_match('/^[A-Z]{1,7}\-\d{1,5}/', trim($timeEntry['notes']), $matches);
    2.  and hours field is not empty

  7. After building an array of Issues with time for the Users with Development Role, Application sends each entry to Jira Cloud
  8. If some Error occurred during a scenario that prevents all process to be executed, Application sends a Notification to Slack and logs the error
    1. example - [TimeLogExport] Failed export of TimeLogs for Date:22.01.2021
  9. If Application wasn't able to send some specific Time Entry to Jira, it sends a Notification to Slack and logs the error
    1. example - [TimeLogExport] Error during adding Worklog for issue IP-139. Time: 258 minutes