ahungry / org-jira

Bring Jira and OrgMode together
668 stars 125 forks source link

Make clocking in/out from agenda work #315

Closed hardliner66 closed 1 year ago

hardliner66 commented 1 year ago

I recently started using emacs and found this plugin (which is really awesome btw).

Now I learned about the org agenda and added the issue to my agenda files, making it really easy to see what I have to do. The agenda view allows to clock in or out on the todos, but it uses the header with the TODO in it to add the clock entry. But if I understand it correctly, it should go into the description part, as it's just my local worklog and it should move to the todo, when it's synced with jira.

Is there any way to get this to work properly?

I'm using doom emacs if that helps.

ahungry commented 1 year ago

@hardliner66 not sure what you mean - when org-jira syncs worklogs, it does it bi-directionally (you add your new time entries into the same LOGBOOK area that was pulled from the server).

From the org-jira POV, you can highlight a top level issue header, and org-clock-in (and eventually org-clock-out). This will generate the LOGBOOK under the issue properties.

If org-agenda is adding these entries into the "description:" sub-heading, that seems unusual (as I think org-agenda tends to list entries based on a TODO tag or DEADLINE etc.).

Since this isn't a bug and I don't have any more info to provide, I'm gonna go ahead and close it out (feel free to continue to discuss though).

hardliner66 commented 1 year ago

That makes sense. I tried it again and now both ways clock under the same heading. This begs the question, how does org-jira check if a time was already synced to jira?

ahungry commented 1 year ago
:LOGBOOK:
CLOCK: [2023-03-02 Thu 00:00]--[2023-03-02 Thu 00:00] =>  0:00
CLOCK: [2022-02-24 Thu 00:00]--[2022-02-24 Thu 00:05] =>  0:05
  :id: 10359
:END:

Random sample - the first entry I just added, but didn't sync yet. Notice the lack of an :id: - the id indicates an existing clock value, while the lack of one implies it needs to be created.

However, one thing to be cautious of - if you add entries and then refresh your issue(s) without syncing back up to Jira first, you could lose the entries (the issue re-render will clear unsaved data and then re-render/save).

hardliner66 commented 1 year ago

That makes sense, but then I'm confused how I got org-jira to add times to jira that were already booked. I'll probably have to play around with it a bit more and check if it happens again.