Coder Social home page Coder Social logo

Groups in Projects about toggl2clockify HOT 6 CLOSED

acseven avatar acseven commented on July 19, 2024
Groups in Projects

from toggl2clockify.

Comments (6)

acseven avatar acseven commented on July 19, 2024

My Python experience is null, but working on top of your code I was able to retrieve groups from toggl and clockify, and was now trying to push synchronization between groups assigned to projects. I won't waste time on assigning Users to Groups as that's relatively easy to do with in the UI.

https://clockify.github.io/clockify_api_docs/#tag-Project

2019-06-17 16:58:43,933 - INFO - toggl2clockify - -------------------------------------------------------------
2019-06-17 16:58:43,933 - INFO - toggl2clockify - Phase x of y: Import groups
2019-06-17 16:58:43,933 - INFO - toggl2clockify - -------------------------------------------------------------
2019-06-17 16:58:45,147 - INFO - Clue - adding group GROUP1 (1 of 5 groups)
2019-06-17 16:58:45,407 - INFO - Clue - User Group GROUP1 already exists, skip...
2019-06-17 16:58:45,408 - INFO - Clue - adding group GROUP2 (2 of 5 groups)
2019-06-17 16:58:45,660 - INFO - Clue - User Group GROUP2 already exists, skip...
2019-06-17 16:58:45,661 - INFO - Clue - adding group GROUP3 (3 of 5 groups)
2019-06-17 16:58:45,925 - INFO - Clue - User Group GROUP3 already exists, skip...
2019-06-17 16:58:45,925 - INFO - Clue - adding group GROUP4 (4 of 5 groups)
2019-06-17 16:58:46,199 - INFO - Clue - User Group GROUP4 already exists, skip...
2019-06-17 16:58:46,200 - INFO - Clue - adding group GROUP5 (5 of 5 groups)
2019-06-17 16:58:46,450 - INFO - Clue - User Group GROUP5 already exists, skip...
2019-06-17 16:58:46,451 - INFO - toggl2clockify - -------------------------------------------------------------
2019-06-17 16:58:46,455 - INFO - toggl2clockify - Phase x of y (Import groups) completed (entries=5, ok=0, skips=5, err=0)
2019-06-17 16:58:46,457 - INFO - toggl2clockify - -------------------------------------------------------------

Clockify's API endpoints for groups are only available in the deprecated version, but they appear to work. Toggl doesn't seem to have public information on how to retrieve groups assigned to Projects, but this one works:

https://www.toggl.com/api/v8/projects/{pID}/project_groups

If I do get to anything actually working I'll try to make a pull request. If I manage to find how to do that...

PS: I don't know if it's the version of Python I'm running but I also had to make this change in ClockifyAPY.py (I added many users that no longer have emails):

if (rv["status"].upper() != "ACTIVE") and (rv["status"].upper() != "PENDING_EMAIL_VERIFICATION"):

EDIT: got it! the code is probably a mess, but groups have sync'ed!

from toggl2clockify.

Coimbra1984 avatar Coimbra1984 commented on July 19, 2024

Cool! Sorry, that I did not find to support you. Can you share the code, please You can open a pull request or just send it to me (markus.proeller (at) pieye.org).
I can than rework on it and try to integrate it.
Thanks for the help!

from toggl2clockify.

acseven avatar acseven commented on July 19, 2024

No worries. I think I've successfully made a pull request #9 for you to have a look. I'll try tasks next, which I think are simpler (more like tags, maybe).
Cheers

from toggl2clockify.

acseven avatar acseven commented on July 19, 2024

I've added Tasks migration to my branch, but I haven't made a pull request as there's one thing missing:

What it does:

  • Syncs tasks assigned to Project in given Workspace
  • Syncs Estimated Duration for task

What it doesn't do (not very relevant in my situation):

  • Sync task assignees
  • Sync task Status
  • Can't sync if --skipProjects

Missing features / to-do:

  • Assign time entries to tasks (on AddEntry).

Additional notes:

  • I've also changed part of how the Projects sync process works. Instead of retrieving Projects for each user, using the Working API you can get all the Projects at once. This makes it a lot faster.
  • The code is very messed up, sorry about that.

from toggl2clockify.

acseven avatar acseven commented on July 19, 2024

Just added assignment of Tasks to Time Entries to the pull request.

It's a mess, but I think it's working for me. Hope you can find something useful in it.

I think some of the stuff I did will result in errors if multiple workspaces exist.

Note: I might have a go on assigning users to their User Groups, because for the Task assignment to work, those connections need to exist and I haven't done that manually yet. After that, I will remove all time entries and run everything again, to see how the data compares between Toggl and Clockify.

from toggl2clockify.

Coimbra1984 avatar Coimbra1984 commented on July 19, 2024

I'm closing this issue, as pull request #9 was merged.

Thanks again for the great contribution!

from toggl2clockify.

Related Issues (14)

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.