Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

How to add new lines to comment body in ADO

 
1
0
-1

Hello, anyone knows how to get new lines in the comment body in ADO? I've added new lines but the comment.body still gets printed on the same line as comment.author.email.


Example of outgoing and incoming


Outgoing on ServiceNow side

replica.comments = customerCase.comments


Incoming on Azure side
if (comment.internal) {

    comment.body = convertedDate + " - " +
    "Internal comment by " +
    comment.author.email + " -\n" +
    comment.body + "\n"

}

  1. Support

    Hi Joel Maanmies,

    We have tried to reproduce your scenario, and we would like to discard this can be a potential bug, could you please raise a support issue case to investigate further? Please check the documentation below:

    https://docs.idalko.com/exalate/x/joHk 

    Kind regards.


CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    Hi Joel Maanmies , as communicated via Support ticket, the below solution has worked.

    We've replaced "\n" with <br/> because in ADO 'comment' is type of HTML so <br/> will resolve a problem.


    Incoming Sync into Azure DevOps:

    //def targetUser = nodeHelper.getUserByEmail(comment.author.email, workItem.projectKey)
        if (comment.internal) {
                //comment.executor = targetUser
                comment.body =
                "Internal comment by " +
                comment.author.email + "<br/>" +
                comment.body + "<br/>"
            } else {
                comment.body =
                "Customer visible comment by " +
                comment.author.email + "<br/>" +
                comment.body + "<br/>"
            }
        }

    Thank you,

    Ashar

      CommentAdd your comment...