How to copy comments (and format) from one site to another

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

   

Summary

How to copy comments from one site to another

Solution

  1. Create a variable called content that has the body of the json to be sent:

    Author ({{issue.comments.last.author.displayName}}):\n"{{comments.last.body.raw.asJsonString}}"\n

    Added " before/after the comment. The reason for this is that we need to keep the " for the content inside the code block section (when it exists). When I add the " with the comment, the final result will be "" before/after. Since this the only scenario where we have "", we can use it with remove("\"") (see the item below).

  2. On next step I created a new variable (contentfinal) that gets the value from content and remove "".


    {{content.remove("\"\"")}}
  3. On the web request, contentfinal is sent:

    {
    "public": true,
      "body": "{{contentfinal}}"
    }



Last modified on Nov 3, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.