HI Team,
using rest Api i just want to get the worklogs day basis on particular person . could you please help me how can i frame the api to get the current day worklog for particular person
Yes, you are right.
The search endpoint returns all worklogs. Initially, we utilized this endpoint to retrieve related issues.
After making this call, iterate through the issues in the response and execute get issue worklogs endpoint to retrieve each issue's worklogs. As parameters, provide the issue key and `startedAfter`(set to today's date). This call will return all worklogs logged today.
As a final step, iterate through these worklogs and filter out those logged by other users.
# Make a GET request to retrieve all worklogs for today associated with a specific user.
GET /rest/api/3/search?jql=worklogDate >= startOfDay() AND worklogDate <= endOfDay() AND worklogAuthor = "Something"
# Iterate through the response to extract related issues.
for each issue in response:
issueKey = issue.key
# Make a GET request to retrieve worklogs for the current issue logged today.
GET /rest/api/3/issue/{issueKey}/worklog?startedAfter=startOfDay()&author="Something"
# Iterate through the worklogs to filter out worklogs logged by other users.
for each worklog in issueWorklogsResponse:
if worklog.author == "Something":
# Process the worklog as needed.
else:
# Ignore worklog logged by other users.
Or Alternatively,
You can directly use the search response to filter out the users and the date.
# Make a GET request to retrieve all worklogs for today associated with a specific user.
GET /rest/api/3/search?jql=worklogDate >= startOfDay() AND worklogDate <= endOfDay() AND worklogAuthor = "Something"
# Iterate through the response to extract related issues.
for each issue in response:
for each worklog in issue.worklogs:
if worklog.author == "Something" and worklog.started >= startOfDay():
# Process the worklog as needed.
else:
# Ignore worklog logged by other users.
HI Tugba,
thanks for the response.
i got the api response using /rest/api/3/search?jql=worklogDate >= startOfDay()AND worklogDate <= endOfDay() AND worklogAuthor = "Something"
this url but i could not able to find the today efforts.
i can see overall efforts which user logged in so far.
how can i take the todays efforts from the response
example:
sub task1
user logged his efforts on 12-03-2024 8h
today he logged his efforts 14-03-2024 6h
if am hit this api today i should get 6h as worklog. could you please help which response tag i have to refer to get todays log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Johnkumar
I'm afraid you cannot directly find the worklogs belonging to a specific user.
However, using the Rest API, you can try the following:
1- Use search endpoint and write the JQL as follows
/rest/api/3/search?jql=worklogDate >= startOfDay()AND worklogDate <= endOfDay() AND worklogAuthor = "Something"
This endpoint returns the issues that the user logged work on.
2- Then use get issue worklogs endpoint to retrieve all worklogs for the specific issue. This returns all worklogs.
3- Filter out the worklogs of other users to find the ones that belong to the specific user.
By the way, I've recently developed an app named Jira Worklog Reporter. It computes the total worklogs logged by users weekly and sends a Slack message detailing their logged work and associated issues.
If you'd like to check it out or see what I've done to address the issue you faced, here is the link to the app: https://actioner.com/app-directory/jira-worklog-reporter-149.
Feel free to give it a try!
Tugba
actioner.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.