mattermost / mattermost-plugin-jira

JIRA plugin for Mattermost 🔌
https://mattermost.gitbook.io/plugin-jira/
Apache License 2.0
98 stars 128 forks source link

Jira link tooltip error: Issue with Jira ticket having an empty `versions` field #1014

Closed mickmister closed 10 months ago

mickmister commented 10 months ago

This sanitized version of data that produced the issue can be used for testing. In the code below, it is the value of the data variable, so it can be hardcoded to the contents of this data file for testing. jira-plugin-test-data.json

Reproduced on the community server, data.fields.versions is undefined on line 393 below:

react-dom.production.min.js:216 TypeError: Cannot read properties of undefined (reading 'length')
    at zr (jira_issue_metadata.tsx:393:40)

https://github.com/mattermost/mattermost-plugin-jira/blob/249614ed5e5e061ca8301427c9421567d4117c9e/webapp/src/utils/jira_issue_metadata.tsx#L385-L396


Also I noticed when this happens, the error shows several times. It seems to happen for every many posts are visible at that time. Created a separate issue for this: https://github.com/mattermost/mattermost-plugin-jira/issues/1015