Skip to content

[Bug] Jira worklogs not collected when issue has fewer than 20 worklogs #9122

Description

@arjasepp

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Jira issue worklogs are not collected by DevLake when a Jira issue has fewer than 20 worklogs. Issues with 20+ worklogs are collected correctly.

Steps to reproduce

  1. Configure a Jira connection and scope with worklog collection enabled.
  2. Trigger a pipeline run.
  3. Observe that worklogs for Jira issues with fewer than 20 worklogs do not appear in the jira_issue_worklogs table.

Expected behavior

All worklogs for all issues should be collected, regardless of the total worklog count per issue.

Actual behavior

Issues with fewer than 20 worklogs have no entries in jira_issue_worklogs. For example, an issue with 7 worklogs returns 0 rows after a full pipeline run.

Root cause hypothesis

The Jira REST API's worklog endpoint (GET /rest/api/2/issue/{issueId}/worklog) paginates results with a default maxResults of 20. The response body includes a total field alongside maxResults and startAt. If the collection logic only follows up with paginated requests when total > maxResults — but skips fetching the first page altogether under some condition — then issues with total < 20 may be silently skipped.

Alternatively, if worklogs are collected via the bulk-updated worklogs endpoint (/rest/api/2/worklog/updated) and an issue's worklogs fall below a threshold that triggers a different code path, the same silent skip could occur.

Environment

  • DevLake version: v1.0.3-beta14 (or the version you are running)
  • Jira plugin version: bundled
  • Jira Server on premise

Additional context

Confirmed on a real project: one Jira issue has exactly 7 worklogs; none are present in the database after a successful pipeline run. Issues on the same board with higher worklog counts collect correctly.

What do you expect to happen

All worklogs for all issues should be collected, regardless of the total worklog count per issue.

How to reproduce

  1. Configure a Jira connection and scope with worklog collection enabled.
  2. Trigger a pipeline run.
  3. Observe that worklogs for Jira issues with fewer than 20 worklogs do not appear in the jira_issue_worklogs table.

Anything else

I got this error when trying to understand if it is possible to get worklogs also from jira to devlake. Problem is that I do not have tasks that have more than 20 worklogs. All this text is generated by AI, but as far as I understand, then problem is there, if not, then sorry for bothering. Our jira is onprem, not in cloud.

Version

v1.0.3-beta14@50f664e

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThis issue is a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions