mergeAttachments

    Signature

    HelperattachmentHelper
    Signature
    mergeAttachments(IHubIssue issue, IHubIssue replica)
    DescriptionAdd all the new attachments of the replica to the issue attachments.
    Remove all the removed attachments of the replica from the issue attachments.
    Introduced in0.12


    Example use

    issue.attachments = attachmentHelper.mergeAttachments(issue, replica)


    Comment

    This helper method is equivalent to:

    // add all new attachments as listed in the replica
    issue.attachments += replica.addedAttachments
    
    
    // remove all attachments from the issue which have been removed in the remote issue
    issue.attachments -= replica.removedAttachments
    
    
    
    
    

    Be careful when specifying the following code, which will delete all local attachments which are not available on the replica.

    issue.attachments = replica.attachments