Skip to content

Wrong unix epoch in admin api requests #322

Open
@m1keru

Description

@m1keru

Hello,
Thank you for your library it's really usefull!
However, I found that Organization API is not working properly.
I noticed during the debug that requests to the API go with Unix timestamp in seconds but Atlassian API wants milliseconds.

Here is the reference to their API:
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-events/#api-v1-orgs-orgid-events-get

from
string

The earliest date and time of the event are represented as a UNIX epoch time in milliseconds.
{"level":"debug","ts":1727100247.123214,"caller":"atlassian_log_exporter/exporter.go:116","msg":"Request HTTP: &{GET https://api.atlassian.com/admin/v1/orgs/xxxxxxxxxx/events?cursor=xxxxxxx%3D&from=1727097755 HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer xxxxx] User-Agent:[curl/7.54.0]] {} 0x661320 0 [] false api.atlassian.com map[] map[] <nil> map[]   <nil> <nil> <nil> {{}} <nil> [] map[]}"}
{"level":"debug","ts":1727100247.123301,"caller":"atlassian_log_exporter/exporter.go:141","msg":"Response HTTP Code: 200"}

Is it possible to change here Unix() to UnixMilli().

timeAsEpoch := int(options.To.Unix())

timeAsEpoch := int(options.From.Unix())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions