attachFile

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Availability

This routine is available starting with SIL Engine™ 1.0.

Syntax

attachFile(path_to_file, issue)

Description

Add an attachment to a selected issue.

Parameters

Parameter name

Type

Required

Description

path to file

string

Yes

Absolute path to the file.

issue key

string

Yes

Key of the issue the file will be attached to.


Return type

boolean (true/false)

The return value represents the success of the attachment process. If the routine returns "true" the file was attached successfully.

Example

string path_to_file;
string issue;
path_to_file = "C:/jira/home/attachment/file_to_attach_1.jpg";
issue = "PRJ-239";
attachFile(path_to_file, issue);

Result: Returns "true" if the file is at the selected location and the issue exists. It means the file was attached. Returns "false" if any of the conditions stated before are not met.

Notes

  1. Use forward slashes ( "/" ) for the path.
  2. The path to the attachment must be absolute and point to a location on the server.
  3. If an error occurs, the routine will return "false" and the error message will be visible in the log.

See also