Need to split source comment into multiple destination comments. (The entered text is too long. )

Originally asked by Kyle K on 15 February 2024 (original question)


Is there a good way to split a single source comment into multiple?

I was thinking something like this, but I’m not sure if there is a function or something to push out multiple comments in a single sync.

static def JiraCharLimit(int commentLenght,String comment ) {
  if (commentLenght < 32767 ){
    //post comment
  }else {
    subcomment = comment.substring(0,32766)
    recursecomment = comment.substring(32767,commentLenght)
    //post subcomment
    JiraCharLimit(recursecomment.lenght(), recursecomment)
  }
}

JiraCharLimit(issue.comments.lenght(), issue.comments)

Answer by Kyle K on 20 February 2024

https://docs.exalate.com/docs/comment-cant-be-created-because-the-text-is-too-long might help for others, but does not seem to in our case.