Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.
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
- Use forward slashes ( "/" ) for the path.
- The path to the attachment must be absolute and point to a location on the server.
- If an error occurs, the routine will return "false" and the error message will be visible in the log.
See also
3 Comments
Anonymous
Hi
Is there a way to set the attachment name?
In the following code, I want to copy attachments from issue orig_key to issue clonekey
and I see the internal JIRA attachment ids in the attachment list of clonekey instead of proper filename.
Maybe there is another way to copy attachments from one issue to another?
Anonymous
I am having the same problem and no solution
Unknown User (fmanaila)
Solution is described here: http://bugs.kepler-rominfo.com/browse/IMJ-84