Copy Linked Issue Comments to Parent Issue

Issue #605 resolved
Weston Rossborough created an issue

I would like to copy comments of a linked issue to the parent issue when the linked issue is closed. I was able to accomplish copying the last comment of a linked issue by following the instructions outlined here.

Is it possible to copy over all comments from the linked issue? If so, I would also like to include and preserve information on when the comments were made and whom they were made by if also possible.

Thanks

Weston

Comments (9)

  1. Fidel Castro Armario repo owner

    Hi Weston,

    Sorry for the delay in my response. Currently is not possible to copy all the comments as comments to other issue, but you can compose a text with all the comments of an issue and their creators, and copy it to a text field. To do it you have to use the following text expression (in advanced parsing mode):

    toString(textOnStringList(allComments(), nthElement(allCommenters(), indexOf(^%, allComments())) + ": \n" + ^%), "\n\n")
    
  2. Weston Rossborough reporter

    Hi Fidel,

    Thanks for the response back. This actually accomplishes what I was looking for! Is it possible to include the date/time of the child comments that are copied to the parent issue?

    Thanks,

    Weston

  3. Fidel Castro Armario repo owner

    Sorry @WestonR, but currently is not possible to add date/time information for the comments. I'm including it in the to-do list for future versions of the plugin.

  4. Weston Rossborough reporter

    No worries, these instructions help greatly! You can go ahead and close this ticket.

  5. Weston Rossborough reporter

    Hi Fidel,

    While testing this solution I noticed the following problem. Comments copied from the linked child ticket to the parent ticket don't seem to display the commenters correctly. I created a test ticket, created a linked ticket as the child, then added several comments between my account and a test account. Here were the results I got from this test.

    Comments in child ticket: CommentsInChildTicket.jpg

    Comments in parent ticket: CommentsInParentTicket.jpg

    As you can see the comments that are copied to the parent ticket from the child display the wrong name for the commenter. It seems like it's getting hung up when a different user adds a comment to the child ticket.

    Here are the screenshots of the post functions I'm using.

    Post Function to create child comment: PostFunction1.jpg

    Complete Post Functions: PostFunctionFull.jpg URL) causing this?

  6. Fidel Castro Armario repo owner

    Sorry, I used allCommenters() mistakenly. The correct function to use is allCommentCreators().

    Use the following string expression:

    toString(textOnStringList(allComments(), nthElement(allCommentCreators(), indexOf(^%, allComments())) + ": \n" + ^%), "\n\n")
    
  7. Log in to comment