Skip to end of banner
Go to start of banner

copyAttachment

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


Availability

This routine is available starting with katl-commons 4.0.3.

This routine is available for Jira server and cloud deployment options.

Syntax

copyAttachment(issueKey1, attachmentName, issueKey2)

Description

Copies an attachment from one issue to another.


Parameters

Parameter name

Type

Required

Description

issueKey1

string

Yes

Issue key.

attachmentNamestringYesAttachment name.
issueKey2stringYesIssue key where you want to copy the attachment.

Return type

boolean (true/false)

Returns "true" if the attachment was copied successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.

Example


Example 1

copyAttachment("TEST-1", "attachmentToCopy.txt", "TEST-2");

If you have multiple attachments on an issue with the same file name, all of them will be copied.

Example 2

Copy all the attachments from one issue to another.

string issueKey = "TEST-1";
for(string s in issueKey.attachments) {
    copyAttachment(issueKey, s, "TEST-2");
}


See also

  • No labels