[Bug][jira plugin] devlake collection jira server information
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
lake-v0110-devlake-1 | time="2022-07-20 01:19:53" level=error msg=" [task #24] [jira] retry #2 for http code error[404]:[{"errorMessages":["用户“[email protected]”不存在"],"errors":{}}]" lake-v0110-devlake-1 | time="2022-07-20 01:19:54" level=error msg=" [task #24] [jira] retry #2 for http code error[404]:[{"errorMessages":["用户“[email protected]”不存在"],"errors":{}}]" lake-v0110-devlake-1 | time="2022-07-20 01:19:56" level=error msg=" [task #24] [jira] retry #2 for http code error[404]:[{"errorMessages":["用户“[email protected]”不存在"],"errors":{}}]"
execute task fail
What you expected to happen
collection jira server information success
How to reproduce
curl http://127.0.0.1:8080/rest/agile/1.0/board/85/issue?expand=changelog&jql=ORDER+BY+created+ASC&maxResults=100&startAt=0
"changelog":{"startAt":0,"maxResults":13,"total":13,"histories":[{"id":"148308","author":{"self":"http://127.0.0.1:8080/rest/api/2/user?username=aaa","name":"aaa","key":"aaa","emailAddress":"[email protected]","avatarUrls":{"48x48":"http://127.0.0.1:8080/secure/useravatar?ownerId=aaa&avatarId=11401","24x24":"http://127.0.0.1:8080/secure/useravatar?size=small&ownerId=aaa&avatarId=11401","16x16":"http://127.0.0.1::8080/secure/useravatar?size=xsmall&ownerId=aaa&avatarId=11401","32x32":"http://127.0.0.1:8080/secure/useravatar?size=medium&ownerId=aaa&avatarId=11401"},"displayName":"sss
no accountID tag
modify apiv2models/user.go
func (u *User) getAccountId() string { if u == nil { return "" } if u.AccountId != "" { return u.AccountId } //add this code,run success,no test for jira cloud if (u.AccountId == "") && (u.Name != "") { return u.Name } return u.EmailAddress }
Anything else
No response
Version
v0.11.0
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@jinzhu2002 Interesting, so right now you can make sure that you can get jira user info by the token, but devlake still return 404?
yes ,jira collection tasks run success,no any Errors。but no test for jira cloud
Right now, jira collection can work successfully.
@warren830 I encounter the same problem, how to solve it?
Hi @kyleliu1008
From @jinzhu2002 's suggestion, you can modify this file plugins/jira/apiv2models/user.go to the below
func (u *User) getAccountId() string {
if u == nil {
return ""
}
if u.AccountId != "" {
return u.AccountId
}
//add this code,run success,no test for jira cloud
if u.Name != "" {
return u.Name
}
return u.EmailAddress
}
we will fix this bug in the next version
This should not be closed until we solve the problem in our main branch.
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.