Forums

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

How to retrieve all the WorkLog Ids upadted in last 24 hrs ?

aagnihotri January 26, 2023

Hi,

I am using REST api to pull the worklog IDs. I have this endpoint to get the updated worklog Ids but i want to pull IDs for only those work log which got updated within last 24 hrs. I don't know how to pass date parameters. Can anyone help me out in this ?

I did this to get updated worklogs 

Updated WorkLogs.png

 

but i want to pass date parameter to get the ids for last 24 hrs. 

1 answer

1 accepted

2 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
January 27, 2023

Hi @aagnihotri 

Try the following:

https://koxaras.atlassian.net/rest/api/3/worklog/updated?expand=values&since=1672713311000

You have to replace the last value 1672713311000 to your desired timestamp. In order to find this timestamp use this link https://www.epochconverter.com/ or a similar converter.

api worklog.png

Let me know if you got this thing working!

aagnihotri January 27, 2023

Thanks @Alex Koxaras -Relational- for the reply. From the above snap it seems that if i want to pull the updated work logs since last 24 hours then i have to pass the yesterday time and date in millisecond in since parameter. My time zone is India means UTC+5:30 so if i want to pull the data since yesterday then i can pass 1674671400000 but this would be static . Is there any way to pass the value to since like Today's time -1 to keep it dynamic all time ?

 

image.png

Alex Koxaras -Relational-
Community Champion
January 27, 2023

Hi @aagnihotri unfortunately I'm not aware of how to do that, if possible.

aagnihotri January 27, 2023

@Alex Koxaras -Relational- No worries . I will search about that and when i get a solution then i will post that solution in comment. Thanks for your help :) 

Wojciech Wardaszko
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2023

Hi @aagnihotri 
You would need to write a script that would calculate the start datetime of the last month, transform it into Unix timestamp format and pass it as a parameter to your query. Should be doable in every environment, .NET comes to mind as a possible solution.

Sadly I'm not skilled in these things to write a script for you, but I hope I managed to point you in the right direction.

Cheers

Like aagnihotri likes this
aagnihotri February 1, 2023

@Wojciech Wardaszko 

 

Thanks for the suggestion :) 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events