Skip to content

Chronos

Chronos is a micro software application we’ve developed at Planet Argon. It bridges the gap between Harvest and JIRA by taking each employee’s time entries from Harvest and adding that logged time to individual tickets in JIRA.

  • Centralized Time Tracking: Not every task we undertake is a JIRA ticket, but with Chronos, we can still ensure consistent time logging.

  • Budget & Expenses Handling: JIRA doesn’t manage budgets, hourly rates, or expenses, but Harvest does. Chronos ensures that we can handle both time tracking and financial matters seamlessly.

  • Accuracy: Chronos automatically transfers logged time from Harvest to JIRA tickets. This capability means our team and clients can review individual JIRA tickets to see the time spent on them and how it matches original estimates.

  • Error Handling: If Chronos can’t find a corresponding JIRA ticket for a time entry or if there’s a mismatch, it sends an email to the concerned employee, prompting a manual correction. It’s also a mechanism to catch misallocations, ensuring we don’t bill the wrong client.

  • Nightly Scans: Chronos reviews Harvest’s time logs from the previous day each night.

  • JIRA Ticket Detection: For every time entry, Chronos checks for a JIRA ticket number. If found, it logs that time to the respective ticket.

  • Error Notifications: If no ticket number is identified or if there’s a project mismatch, Chronos sends an email to ensure manual adjustments.

For any issues, concerns, or questions regarding Chronos, please reach out to Robby.

  1. To add someone to Chronos, they need to generate an API token.
    • Visit Atlassian Security.
    • Click on “Create and manage API tokens”.
    • Send the generated token to your manager, preferably via Slack DM.

For historical data retention and integrity, we don’t remove users from Chronos. Instead, we disable them. To disable a user:

  1. Access the Rails console:
    Terminal window
    heroku run console -a pa-chronos-app
  2. Find the specific user:
    Terminal window
    user = User.where(email: 'example@planetargon.com').first
  3. Disable the user:
    Terminal window
    user.active = false
  4. Save the changes:
    Terminal window
    user.save

Chronos doesn’t have a functional user interface. User management is handled through the console. The following are common tasks you can run to manage users.

  • Adding a Contractor:

    The Chronos User has an is_internal_staff attribute that allows us to distinguish between employees(true) and contractors (false). When adding a contractor, set that attribute to false:

    Terminal window
    => User.create(first_name: 'Graeme', last_name: 'Nelson',
    email: 'graeme@planetargon.com', jira_username: 'graeme',
    jira_api_token: 'GET-API-TOKEN-FOR-PERSON',
    harvest_user_id: '3279723', active: true,
    is_internal_staff: true,
    password: 'MEEP-CHANGEME', password_confirmation: 'MEEP-CHANGEME')
    => exit
  • Running an Authentication Check:

    Terminal window
    heroku run bundle exec rake jira_api:test_authentication -a pa-chronos-app
  • Running an Ad Hoc Rake Task:

    Terminal window
    rake time_entries:adhoc_transfer

    Arguments:

    • START_DATE (if this is not set it will default to today’s date)

    • END_DATE (if this is not set it will default to today’s date)

      Terminal window
      heroku run rake time_entries:adhoc_transfer START_DATE="Jun 8 2017" END_DATE="Jun 8 2017" --app pa-chronos-app
    • USERS (separate user email addresses with commas)

      Terminal window
      rake time_entries:adhoc_transfer USERS="carlos@planetargon.com,gary@planetargon.com"

      If no users are specified it will use all of the users in the system one at a time.

    • DRY_RUN (if yes or true then nothing will be transfered but items will be logged to the screen. If it’s omitted then it will automatically be false.)

      Terminal window
      rake time_entires:adhoc_transfer DRY_RUN="true"
    • EXAMPLE ON HEROKU:

      Terminal window
      heroku run rake time_entries:adhoc_transfer START_DATE="Mon, 12 Dec 2016" END_DATE="Sun, 18 Dec 2016" USERS="scott@planetargon.com" DRY_RUN="true" --app pa-chronos-app
  • Sending a Harvest Report to a User

    Terminal window
    heroku run rake harvest_user_budgets:send_report START_DATE="Sept 20 2021" END_DATE="Sept 27 2021" USERS="robby@planetargon.com" --app pa-chronos-app