attachFile

Description

Add an attachment to a selected issue.

Parameters

Return Type

Boolean

The return value represents the success of the attachment process. If the function 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.

 

  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 function will return "false" and the error message will be visible in the log.

 

See also