dosubot[bot] commented on issue #8698:
URL: 
https://github.com/apache/incubator-devlake/issues/8698#issuecomment-3854518711

   <!-- Answer -->
   This happens because after uploading users via 
`/api/rest/plugins/org/users.csv`, the new users are not automatically linked 
to their corresponding accounts in the user-account mapping table. Only commit 
activities are shown because those are matched by author info, but activities 
like "Review PR" or "Open a PR" require a proper user-account linkage to appear 
in work logs. 
   
   To fix this, make sure you also upload a `user_account_mapping.csv` via the 
`/api/rest/plugins/org/user_account_mapping.csv` endpoint after adding new 
users. This will link users to their accounts and allow all activities to be 
mapped correctly. Alternatively, you can trigger the user-account linking logic 
(ConnectUserAccountsExact) to match users and accounts by email, full name, or 
username. Without this step, only commit activities will show up for new users, 
while PR-related activities will be missing because the mapping is incomplete 
[see code 
details](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/org/api/user.go#L65-L104)
 [and mapping 
logic](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/org/tasks/user_account.go#L37-L110).
   
   After updating the user-account mapping, re-run your data collection or 
refresh your dashboards to see the full set of activities for the new users.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/c83c2d50-c526-4791-b384-2fbbf5e35a74?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20happens%20because%20after%20uploading%20users%20via%20%60/api/rest/plugins/org/users.csv%60%2C%20the%20new%20users%20are%20not%20automatically%20linked%20to%20their%20corresponding%20accounts%20in%20the%20user-account%20mapping%20table.%20Only%20commit%20activities%20are%20shown%20because%20those%20are%20matched%20by%20author%20info%2C%20but%20activities%20like%20%22Review%20PR%22%20or%20%22Open%20a%20PR%22%20require%20a%20proper%20user-account%20linkage%20to%20appear%20in%20work%20logs.%20%0A%0ATo%20fix%20this%2C%20make%20sure%20you%20also%20upload%20a%20%60user_account_mapping.csv%60%20via%20the%20%60/api/rest/plugins/org/user_account_mapping.csv%60%20endpoint%20after%20adding%20new%20users.%20This%20will%20link%20users%20to%20their%20acco
 
unts%20and%20allow%20all%20activities%20to%20be%20mapped%20correctly.%20Alternatively%2C%20you%20can%20trigger%20the%20user-account%20linking%20logic%20%28ConnectUserAccountsExact%29%20to%20match%20users%20and%20accounts%20by%20email%2C%20full%20name%2C%20or%20username.%20Without%20this%20step%2C%20only%20commit%20activities%20will%20show%20up%20for%20new%20users%2C%20while%20PR-related%20activities%20will%20be%20missing%20because%20the%20mapping%20is%20incomplete%C2%A0%5Bsee%20code%20details%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/org/api/user.go%23L65-L104%29%C2%A0%5Band%20mapping%20logic%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/org/tasks/user_account.go%23L37-L110%29.%0A%0AAfter%20updating%20the%20user-account%20mapping%2C%20re-run%20your%20data%20collection%20or%20refresh%20your%20dashboards%20to%20see%20the%20full%20set%20of%20activiti
 es%20for%20the%20new%20users.)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8698)


-- 
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]

Reply via email to