Fix import of issues without body message#115
Fix import of issues without body message#115ssinhaleite wants to merge 2 commits intogavinr:masterfrom
Conversation
The CSV import threw an error when an issue didn't have a body defined. Since it is a good practice to have a body defined, in the case of importing issues, we duplicate the title into the body. While this doesn't clarify the issue, it highlights the problem and still imports the issue.
|
Hi @ssinhaleite, thanks for the PR.
Can you tell me more about the error that you received? Was it from this library or from the GitHub API? Can you provide an example CSV that causes the error to happen? Thanks! |
|
Hi @gavinr! I've just added a CSV example file that would raise an error. It generates the following error message: |
|
Hi @gavinr, Yes, indeed it is possible to create an issue without body content in the web interface, and replicating the title in the body of an issue is not the ideal case. However, although the REST API (https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#create-an-issue) says the title is the only required field, I had tried to create an issue with the title and without a body, and I keep getting the error: 422 - "missing field: body". This error contains the same structure as if I try to create an issue with a body and no title, which indicates the body is being considered a required field. The error doesn't appear if I remove any other field. I understand if this is not a solution for you. I forked the project and added this solution to my fork of your code. Thank you for your consideration. |

The CSV import threw an error when an issue didn't have a body defined. Since it is a good practice to have a body defined, in the case of importing issues, we duplicate the title into the body. While this doesn't clarify the issue, it highlights the problem and still imports the issue.
Another option would be to remove the verification that the body is empty whatsoever, and if a body column exists, just add it the way it is, even if empty.