com.atlassian.jira.util.json.JSONObject jsonObject = new com.atlassian.jira.util.json.JSONObject();
jsonObject.put("internal", false);
ComponentAccessor.getCommentManager().create(issueObject,
newUser,
newUser,
emailMessage, null, null, null, null,
new HashMap() {
{
put("sd.public.comment", jsonObject);
}
}, true, true);
In the development of JSM plugins, I am using com.atlassian.jira.issue.comments.Comment.create(Issue var1, ApplicationUser var2, ApplicationUser var3, String var4, String var5, Long var6, Date var7, Date var8, Map<String, JSONObject> var9, boolean var10, boolean var11);
When using this method, the comment set at this time is an external comment, but when creating a comment event and publishing it with boolean var10 being true, the system will automatically change my comment to an internal comment