Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIRA: create worklog entry after stopping the timer #28

Closed
dpashkevich opened this issue Dec 18, 2013 · 3 comments
Closed

JIRA: create worklog entry after stopping the timer #28

dpashkevich opened this issue Dec 18, 2013 · 3 comments

Comments

@dpashkevich
Copy link
Contributor

This is actually the main problem I expect from toggl-button to solve, because at the moment we manually copy Toggl time entries to Jira worklog which is inconvenient and error-prone...

@dpashkevich
Copy link
Contributor Author

JIRA has REST API that supports authentication via cookies (so you don't have to obtain any additional tokens when issuing a request from within a browser), however it requires quite a lot of data to be supplied:
https://docs.atlassian.com/jira/REST/ondemand/#d2e1312

{
    "self": "http://www.example.com/jira/rest/api/2/issue/10010/worklog/10000",
    "author": {
        "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
        "name": "fred",
        "displayName": "Fred F. User",
        "active": false
    },
    "updateAuthor": {
        "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
        "name": "fred",
        "displayName": "Fred F. User",
        "active": false
    },
    "comment": "I did some work here.",
    "visibility": {
        "type": "group",
        "value": "jira-developers"
    },
    "started": "2014-01-06T00:00:12.707+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "id": "100028"
}

Tried omitting some parameters and the server didn't like it, will investigate further...

@dpashkevich
Copy link
Contributor Author

My bad, I just forgot the Content-Type: application/json header. Although the docs may freak one out, looks like the following body of parameters is enough:

{
  "comment": "I did some work here.",
  "started": "2014-01-06T00:00:12.707+0000",
  "timeSpentSeconds": 12000
}

Even the comment is optional.
The URL format is: https://company.atlassian.net/rest/api/2/issue/PRJ-123/worklog (assuming that you leave adjust estimate to auto which is default).

Looks doable.

@kristerhaav
Copy link

@dpashkevich - looking into this issue now I'd say we do not intend to post data to JIRA as well in addition to Toggl. But we do have "pipes" (https://github.com/toggl/pipes-api and https://github.com/toggl/pipes-ui) that is fully open-source and can be used to export entries to JIRA. Might want to take a look into it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants