Thundercloud12 commented on issue #9122:
URL: https://github.com/apache/devlake/issues/9122#issuecomment-5709311166
@klesh
Have gone through this. The issue seems to be; in some previous code the
issue collection was migrated to Jira Search API.
### Default Behavior for `fields`
> "By default, the search resource returns only *navigable fields. This is
different from the GET `/issue/{issueIdOrKey}` resource, which defaults to
returning *all fields."
### Why `worklog` is omitted by default
> "Because some fields (such as comment or worklog) can contain large
amounts of data, they are not included in the default *navigable set to ensure
API responses remain performant. If you need these fields, you must explicitly
request them (e.g., `fields=summary,comment`) or request `*all`."
1. Because `fields` is omitted in `setupIssueV2Collector`, Jira Server
returns only *navigable fields.
2. Jira Server completely strips the `worklog` property from the issue
payload.
3. In `issue.go:455`, `i.Fields.Worklog` evaluates to `nil`:
* 0 worklogs are extracted.
* `issue.WorklogTotal` defaults to 0 in `_tool_jira_issues`.
4. When `collectWorklogs` runs, it checks `WHERE i.worklog_total > 20`.
Because `worklog_total` is 0, it skips the issue.
5. Result: 0 worklogs are ever saved for issues on Jira Server.
### A working solution to this can be:
In `issue_collector.go:236`, add:
```go
query.Set("fields", "*all")
```
to `setupIssueV2Collector` so that Jira Server returns all fields.
I am willing to work on this issue!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]