Forums

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

How to get the last worklog on a ticket using REST API

FMassaro March 6, 2019

Hi everyone,

I am trying to get worklog entries from Jira REST API for a specific, at the moment I am using the rest/api/latest/issue/{{issue__key}}/worklog method, but if I still get multiple entries, whereas I would like to get only the most recent one.

Is there a filter I can appli to the GET to only get the most recent one? Should I use a different method?

Is there any way to get the start time of the time entry?

1 answer

1 vote
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2019

Hi Francesco,

You would need to script something to pull out the work log ID's, but once you get them you can call the individual ID in the query with the format:

GET rest/api/latest/issue/{{issue__key}}/worklog/{{Worklog_id}}

The worklog ID can be pulled from the URL in the <"worklogs": [{"self": "self"> section of the rest/api/latest/issue/{{issue__key}}/worklog/ output per issue.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events