Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added property "StartedAfter" to GetWorklogsQueryOptions struct accor… #344

Merged

Conversation

manuelbcd
Copy link
Contributor

Description

Imprevement: Added property "StartedAfter" to GetWorklogsQueryOptions struct according to official API documentation. It allows to filter WorkLog list by indicating the starting date.

The property is documented here (Jira API official documentation) https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/
however there is a known bug so at this moent this parameter is ignored https://jira.atlassian.com/browse/JRACLOUD-73630?error=login_required&error_description=Login+required&state=e6bbdd57-72bf-4334-98ec-248e519e7337
Hopefully it will be fixed in the future. Adding the parameter is not affecting the query.

Example:

	jiraClient, _ := jira.NewClient(tp.Client(), cfg.Jira.Host)
	dateStart := int64(time.Now().Unix())
	var op * jira.GetWorklogsQueryOptions = &jira.GetWorklogsQueryOptions{Expand: "properties", StartedAfter: dateStart}
	issue, _, err := jiraClient.Issue.GetWorklogs(issueid, jira.WithQueryOptions(op))

Checklist

@andygrunwald
Copy link
Owner

Hey @manuelbcd,
thanks for your PR. This is looking good.

Only one small thing: Can you run go fmt over issue.go?

@benjivesterby @ghostsquad What do you think about int64 vs. time.Time as datatype for StartedAfter param?

@benjivesterby
Copy link
Contributor

benjivesterby commented Feb 8, 2021

@benjivesterby @ghostsquad What do you think about int64 vs. time.Time as datatype for StartedAfter param?

According to the docs it's an integer

startedAfter
integer

The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned.

Format: int64

@manuelbcd
Copy link
Contributor Author

Format fixed. Thank you @andygrunwald , @benjivesterby

@andygrunwald andygrunwald merged commit 5806b81 into andygrunwald:master Feb 9, 2021
@andygrunwald
Copy link
Owner

Thanks @manuelbcd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants