Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get IssueId based on WorklogId ?

I am trying to extract worklogs from Jira to upload them in our timesheet app.

To do so, I'd like to use the endpoint Get IDs of updated worklogs in order to retrieve worklogs that were updated since last extraction.

 

My problem is that in the returned JSON:

  • I neither can expand properties to get worklogs details directly
https://<MyJiraCloud>.atlassian.net/rest/api/3/worklog/updated?expand=<???????????>
  • nor get any IssueId in the JSON returned
{"values":
[{"worklogId":10100,"updatedTime":3714749016604,"properties":[]},
{"worklogId":10101,"updatedTime":8914749138088,"properties":[]},
{"worklogId":10102,"updatedTime":5414767934810,"properties":[]}

 

So i am stuck here! I have the list of recently updated worklogs but i can't use them as requesting worklog details implies to know what is the related issue.

See Get worklog definition where "IssueIdOrKey" is mandatory:

GET /rest/api/3/issue/{issueIdOrKey}/worklog/{id}

 

Does anyone has allready encountered this problem and/or has a solution to it? Many thanks!

1 answer

1 accepted

0 votes
Answer accepted

Hi @Frédéric Le Goux ,

There are 2 different ways you can go about this:

  1. Find the worklogs for a specific issue:
    1. Let's say you already have the list of recently updated issues and filtered the list to the recently updated component is worklogs.
    2. From there, you can iterate the issue list to obtain the worklogs for each issue.
  2. Use the same API from Get IDs of updated worklogs:
    1. Not sure if the expand param works, you can try expand=all.
    2. If no luck for the above, then you can use Get Worklogs and use the IDs from the Get IDs of updated worklogs.

I hope that this helps.

Thanks,
Moga

Thank you for the answer @mogavenasan !

 

The second solution you came up with was the best one for me, but I would have preferred not to manage arrays and split the list every 1000 work logs.

For information, expand all return the same fields, i.e. it seems there is only 3 fields returned.

Like mogavenasan likes this

Hey @Frédéric Le Goux,

That's the closest what I can find from the available REST API endpoint.

Glad to know that I can help! :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you