Requires the user executing the API to have a valid zAgileConnect license

Build attachments reference array.

zAgileConnect supports three types of files for sending to Jira Issue:

  • ContentDocument
  • Document
  • Attachment

To send files to Jira Issue, create an array of the class ZCBeans.SalesforceAttachment as follows:

List<zsfjira.ZCBeans.SalesforceAttachment> attachments = new List<zsfjira.ZCBeans.SalesforceAttachment>();

The instance of ZCBeans.SalesforceAttachment contains the File ID and the Issue Key (or issue keys) where you want to send the file.

To send to a single Issue:

Id fileId = ...;
String issueKey = ...;
zsfjira.ZCBeans.SalesforceAttachment attachment = new zsfjira.ZCBeans.SalesforceAttachment(fileId,issueKey);

To send to multiple Issues:

Id fileId = ...;
Set<String> issueKeys = ...;
zsfjira.ZCBeans.SalesforceAttachment attachment = new zsfjira.ZCBeans.SalesforceAttachment(fileId,issueKeys);

The ID should be of an object of type ContentDocument, Document or Attachment.

Sending Attachments to Jira

The Send request is an asynchronous task and a response is posted following completion. You may specify an ID of the object where you want any errors to be posted.

Id onErrorEntityID = ...; 
List<zsfjira.ZCBeans.SalesforceAttachment> attachments = ...;
zsfjira.ZC.Issues.sendAttachments(onErrorEntityID, attachments);

Validate Successful Request:

The method ZC.Issues.sendAttachments returns the result of the operation

zsfjira.ZCBeans.AttachmentRequestResult requestResult = zsfjira.ZC.Issues.sendAttachments(onErrorEntityID, attachments);

Sending attachments to a different Jira Connection

In the example above the Jira connection Id was not specified when sending the attachment, as a result, the attachment will be sent in the Jira marked as default on your zAgileConnect settings:

For specifying a different Jira you must know the Connection ID related to that Jira, accessible via zAgileConnect Settings:

The Jira Connection ID is a unique identifier for specifying a Jira when calling the zAgileConnect API.  For example, to send an attachment to the Jira JccJiraCloud, specify its Jira Connection ID j01 when calling the method:

zsfjira.ZC.Issues.sendAttachments('j01', onErrorEntityID, attachments);