Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get all worklogs update in the last hour via REST API

Reza Seedin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2019

Hi All,

I want to pull out work log entries (time entries) that were updated within the last day or even last hour from all Issues in a project. (or even multiple projects).

I basically after the Hours spent and the comment

Has anyone been able to do this without a paid plugin?

PS worklogUpdated does not exist but wish there was a field like that

{ 
"jql": "project = RSP AND worklogUpdated>= -1h",
"startAt": 0,
"maxResults": 50,
"fields": ["key","summary","id", worklog , comment, timeSpent"]
}

 

I see the fields comment, updated and timespent updated when a query  the issue directly https://%%%%%.atlassian.net/rest/api/3/issue/RSP-4/worklog

 "created": "2019-08-09T14:54:03.684+1000",
"updated": "2019-08-09T15:30:36.765+1000",
"started": "2019-08-09T12:53:51.983+1000",
"timeSpent": "3h",
"timeSpentSeconds": 10800,
"id": "10006",
"issueId": "11837"
"comment": { "version": 1, "type": "doc", "content":
[ { "type": "paragraph", "content":
[ { "type": "text", "text": "second time entry 22222" } ] } ] },

 

2 answers

1 vote
Alberto T. Simon (TC) August 30, 2019

There are 2 methods to that:

1) To get all worklog that was updated (inserted or changed) since a specific timestamp:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-worklog-updated-get

2) To get all worklog that was deleted since a specific timestamp:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-worklog-deleted-get

It's not perfect, though: you can't filter by anything else, and the "expand" parameter doesn't seems to work: you have to use a third method to get the worklogs and their properties, and THEN you get the issues, and THEN the projects, and so on...

That's a sad example of half-backed implementations Atlassian does in their API: it makes harder for us to benefit fully.

0 votes
Wesley Harris August 13, 2019

Doesn't look like the API supports it. You'd have to periodically query all issues' worklogs and filter the results by updated >= -1h

 

Can I ask what you're trying to achieve? We're working on a feature which shows what people have been working on (for a configurable timeframe). I know you didn't want paid addons, so I won't pitch you :)

Reza Seedin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2019

Hi @Wesley Harris ,

I am planning to pull the time entries(worklogs) from Jira when people people add their time. I would then combine that info with a few fields from the Issue itself (Customer , isBillable ect) and then post it into a EPR solution (NetSuite) where the time entries are used to bill customers (via NetSuite).

Is this paid plugin able to achieve what I need?

Wesley Harris August 14, 2019

It should be able to after we're done with the feature. Although we weren't necessarily planning to integrate to NetSuite, we'd definitely be open to it. If you'd like to chat further, feel free to mail me on wesley@withcomb.com

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events