Coder Social home page Coder Social logo

obsidiantimesheet's Introduction

Obsidian Timesheet 🏢 📑 ⌛

ESLint

It is a plugin for Obsidian designed to generate timesheets for tasks in daily notes.

🙂 How does it work?

I assume you use daily notes to log the time you spend solving tasks, which are tracked in JIRA.

Note

You can track your tasks anywhere else; it doesn't really matter. I say JIRA since this software is pretty popular and, what's more important, its functionality, which I should mention, is not too different from similar ones in other trackers.

JIRA allows you to create different projects for issues; each project has its own unique prefix for issues belong to it. For instance, if the prefix is “FBI”, the project has issues like “FBI-1”, “FBI-2”, etc.

So, a part of your daily note may look like this:

- [ ] 10:00-12:00 Look around and find out what is wrong with the production server (FBI-1)
- [ ] 12:00-16:00 Estimate a feature development (FBI-2)
- [ ] 16:00-18:00 Fix a problem on the production server (FBI-1)

There are three tasks listed, two of which are related to the same JIRA issue. The plugin is able to group and round up the time you spent on JIRA issues to show you a convenient report. You can use it while attending the next daily meeting or to get a quick calculation of spent time to log it in JIRA.

Basically, the only thing you need is to insert a timesheet code block anywhere in the daily note and see something like this:

FBI-1 (4h)

- Look around and find out what is wrong with the production server
- Fix a problem on the production server

FBI-2 (4h)

- Estimate a feature development

You can see more examples in the sample vault.

🤔 Questions

How the plugin finds issue numbers?

To be short, it is considering any sequence “X-Y” as a JIRA task number, if X is a set of capital letters and Y is a number. If you need more details or want to change this behavior, read the full answer below.

To be certain, the plugin uses patterns you can redefine. Basically, I'm speaking about regular expressions that the plugin applies to each task title to find a task number in it.

Note

I used to think that regular expressions mechanic was a way too complex tool for this plugin, but then I was like “oh, come on, who is going to use this, after all? let's be honest, a nerd like you and you both know how regexps looks like” :)

By default, there is only one pattern which is set in the plugin's settings: [A-Z]+-\d+ ([A-Z]+ here is "one or more capital letters", while \d+ means "any number"). It's enough to catch almost any JIRA issue number.

Tip

Though, it's probably a good idea to set specific patterns for your use case to avoid false positives. For the project I mentioned above as an example, it can be FBI-\d+.

There are two ways to define task number patterns. Firstly, you can enlist them right in a timesheet code block (one row, one template). Like this:

```timesheet
FBI-\d+
CLSFD-\d+
```

This will affect only this code block.

You can also do it globally via the plugin's settings: take a look at the “Default task number patterns” setting. The format is the same: one template per row. The setting will impact all empty timesheet code blocks.

How can I change how the report renders?

By default, the report uses callouts to show you the report. You can change this via the plugin's settings; there are few templates intended to do it in the “Templates” section.

Basically, you can specify the template for header of the whole report, for a task, for a log line, and for the footer. Macros you can use in each one specified directly in the plugin's settings.

                    ← header (can be omitted)
FBI-100 (8h)        ← task
- Roam around       ← task log
- Find out          ← task log
                    ← footer (can be omitted)

Tip

We track issues in JIRA, so I added its URL as a prefix to my task template for Timesheet. Like this:

>
> https://my.jira.net/browse/{taskNumber} ({taskDuration})

Voilà! Now Timesheet also shows me active links to JIRA instead of plain, boring issue numbers.

Why is the timesheet not updating when I'm changing tasks?

It is something like a known issue (take a look at the note below). Currently, the timesheet code block updates when you open a note. You can also trigger updating by starting to edit a code block and then leaving it.

Note

I was looking for a way to implement automatic updating for the report in this case, but found nothing except the obvious “if a note changes, redraw the whole note”. It sounds dumb and inefficient, so I didn't implement it.

If you know how to solve this problem in the right way, tell me please!

obsidiantimesheet's People

Contributors

vkostyanetsky avatar

Stargazers

zeroits avatar a13ph avatar  avatar Ondrej David avatar

Watchers

Ian Campbell avatar  avatar

obsidiantimesheet's Issues

[FR] - Dataview query-able

I like the simplicity and cleanliness!
By any chance, is it technical possible to make this queryable with dataview?
So this data can be acted upon with the charts/chartsview/plotly plugin.

Thanks in advance and greetings from Germany.

[Question]

I want to use this, as a way to track my time as a whole (not for jira tickets.)

I imagine it using it this way:
1:00-3:00 establishing clear boundaries ([[Filename]])
3:25-3:55 thinking about structure ([[Filename2]])
4:25-4:55 refining boundaries ([[Filename]])

in the timebox:
I would like to see:
[[Filename]] (xh xxm)

  • establishing clear boundaries
  • refining boundaries
    [[Filename2]] (xh xxm)
  • thinking about structure

If #3 is possible, I would like to use these values:
[[Filename]] (xh xxm) and
[[Filename2]] (xh xxm)

To use the folders that they are in to group and visualize the collected data

[FEATURE] Define source file to pull data from

I really like your idea so far! One feature request I'd like to make - if it's technically possible:
Add a setting that lets the code blocks either

  • pull data from the current file OR
  • pull data from the last working day

and add another setting, specifying the working days (like Mon, Tue etc.) as a list.

This way one could see the previous working day's timesheet in today's daily note and be even better prepared for the daily :)

Working with Tasks Plugin

If this Plugin could somehow work with the Tasks Plugin and count the Time spent in Tasks that are scheduled for a given Day that would be the holy grail for me. Is something like that planned ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.