Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This routine is available starting with katl-commons 4.0.3.

This routine is available for Jira server and cloud deployment options.
Info
titleAvailability
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

copyAttachment(issueKey1, attachmentName, issueKey2)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Copies an attachment from one issue to another.

Copies an attachment from one issue to another.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

issueKey1

...

String

Yes

Issue key.

attachmentName

...

String

Yes

Attachment name.

issueKey2

...

String

Yes

Issue key where you want to copy the attachment.

Return

...

Type

Boolean

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.

...

Examples

Example 1

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

...

Note

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.

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

Note

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

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "attachment_routine" and space = currentSpace ( )
labelsattachmentarray_routineroutines