zAgileConnect API Reference (Operations)
ZC Classes
ZC.IssueApi
Methods:
List<ZCBeans.IssueUpsertResult> bulkCreateIssues(List<ZCBeans.IssueTemplate> lstIssues)
Creates multiple issues from a list of templates.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be created.
Return Value:
A list of results corresponding to each template in the input.
Example:
CODE
|
List<ZCBeans.IssueUpsertResult> bulkUpdateIssues(List<ZCBeans.IssueTemplate> lstIssues)
Updates multiple JIRA issues from a list of templates.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be updated.
Return Value:
A list of results corresponding to each template of the input.
Example:
CODE
|
ZCBeans.IssueUpsertResult createIssue(ZCBeans.IssueTemplate issue)
Creates an issue from a template. This method must only be used for creating a single issue. For creating multiple issues, please refer to bulkCreateIssues.
Parameters:
ZCBeans.IssueTemplate issue Issue template representing the issue to be created.
Return Value:
An object containing Issue key on successful execution or errors
Example:
CODE
|
ZCBeans.IssueCommentResult createJIRAIssueComment(String issueKeyOrId, String comment)
Create comment in JIRA issue.
Parameters:
String issueKeyOrId The JIRA Issue key or Id
String comment Comment body.
Return Value:
The result of the operation.
Example:
CODE
|
ZCBeans.IssueDeleteResult deleteIssue(String issueKey, Id entityId)
Delete a JIRA Issue created from a Salesforce entity.
Parameters:
String issueKey The JIRA issue key.
Id entityId The Salesforce entity Id
Return Value:
Result of the Delete operation.
Example:
CODE
|
List<ZCBeans.IssueDeleteResult> deleteIssues(Set<String> selectedIssueKeys, Id entityId)
Delete a list of JIRA Issues created from a Salesforce entity.
Parameters:
Set<String> selectedIssueKeys The JIRA issues to be deleted.
Id entityId The Salesforce entity Id.
Return Value:
List of results of the Delete operation.
Example:
CODE
|
ZCBeans.AvailableTransitionsResult getAvailableTransitions(String issueKey)
Retrieves available Issue Transitions
Parameters:
IssueKey Issue Key
Return Value:
ZCBeans.AvailableTransitionsResult
Example:
CODE
|
ZCBeans.IssueLinkUnlinkResult linkIssue(String issueKey, Id entityId)
Links an issue to a specified Salesforce entity.
Parameters:
String issueKey The JIRA issue key.
Id entityId The Salesforce entity Id.
Return Value:
Result of the Link operation
Example:
CODE
|
List<ZCBeans.IssueLinkUnlinkResult> linkIssues(Set<String> selectedIssueKeys, Id entityId)
Links a list of JIRA Issues to a Salesforce entity.
Parameters:
Set<String> selectedIssueKeys The JIRA issues to be linked.
Id entityId The Salesforce entity Id.
Return Value:
List of results of the Link operation.
Example:
CODE
|
void postCreateIssueErrorMessage(String errorMessage, ZCBeans.IssueUpsertResult issue)
Post errors of a single issue creation event to its related Salesforce entity.
Parameters:
String errorMessage A prefix concatenated with the error messages.
ZCBeans.IssueUpsertResult issue The result from a create or validate operation (only error messages will be posted)
Example:
CODE
|
void postCreateIssueErrorMessage(ZCBeans.IssueUpsertResult issue)
Post errors of a single issue create to its related Salesforce object.
Parameters:
ZCBeans.IssueUpsertResult issue The result from a create or validate operation (only error messages will be posted)
Example:
CODE
|
void postCreateIssueErrorMessages(String errorMessage, List<ZCBeans.IssueUpsertResult> lstIssues)
Post errors of multiple issue creation events to their relates Salesforce entities.
Parameters:
String errorMessage A prefix concatenated with the error messages.
List<ZCBeans.IssueUpsertResult> lstIssues The results from a bulk create or validate operation (only error messages will be posted)
Example:
CODE
|
void postCreateIssueErrorMessages(List<ZCBeans.IssueUpsertResult> lstIssues)
Post errors of multiple issue creation events to their relates Salesforce entities.
Parameters:
List<ZCBeans.IssueUpsertResult> lstIssues The results from a bulk create or validate operation (only error messages will be posted)
Example:
CODE
|
void postErrorMessage(Id entityId, ZCBeans.IssueLinkUnlinkDeleteResult iresults)
Post errors from the result of single link, unlink or delete operation to a target Salesforce entity.
Parameters:
Id entityId The entity where the errors are going to be posted.
ZCBeans.IssueLinkUnlinkDeleteResult iresult Result from link, unlink or delete operation (only error messages will be posted)
Example:
CODE
|
void postErrorMessages(Id entityId, List<ZCBeans.IssueLinkUnlinkDeleteResult> iresults)
Post errors from results of link, unlink or delete operations to a target Salesforce entity.
Parameters:
Id entityId The entity where the errors are going to be posted.
List<ZCBeans.IssueLinkUnlinkDeleteResult> iresults Results from link, unlink or delete operations (only error messages will be posted)
Example:
CODE
|
void postErrorMessages(List<ZCBeans.GenericErrorMessage> errorMessages)
Post errors from a List containing a list of ZCBeans.GenericErrorMessage built by the user.
Parameters:
List<ZCBeans.GenericErrorMessage> errorMessages, the error messages, each element contains the error and the target(entity Id where it must be posted)
Example:
CODE
|
void postErrorMessagesToEntity(Id entityId, String errorMessage, List<ZCBeans.IssueUpsertResult> lstIssues)
Post errors of multiple issue update events to a target entity Id.
Parameters:
Id entityId The target entity.
String errorMessage A prefix concatenated with the error messages.
List<ZCBeans.IssueUpsertResult> lstIssues The results from a bulk update or validate operation (only error messages will be posted)
Example:
CODE
|
void postErrorMessagesToEntity(Id entityId, List<ZCBeans.IssueUpsertResult> lstIssues)
Post errors of multiple issue update events to a target entity Id.
Parameters:
Id entityId The target entity.
List<ZCBeans.IssueUpsertResult> lstIssues The results from a bulk update or validate operation (only error messages will be posted)
Example:
CODE
|
void postErrorMessageToEntity(Id entityId, String errorMessage, ZCBeans.IssueUpsertResult issue)
Post errors of a single issue update
Parameters:
Id entityId The target entity.
String errorMessage A prefix concatenated with the error messages.
ZCBeans.IssueUpsertResult issue The result from an update or validate operation (only error messages will be posted)
Example:
CODE
|
void postErrorMessageToEntity(Id entityId, ZCBeans.IssueUpsertResult issue)
Post errors of a single issue update
Parameters:
Id entityId: the target entity
ZCBeans.IssueUpsertResult issue The result from an update or validate operation (only error messages will be posted)
Example:
CODE
|
ZCBeans.AttachmentRequestResult sendAttachments(Id onErrorEntityID, List<ZCBeans.SalesforceAttachment>attachments)
Perform a request to JIRA to download the given Salesforce file(s).
Parameters:
Id onErrorEntityID The entity where the error messages will be posted.
List<ZCBeans.SalesforceAttachment> attachments A list of files.
Return Value:
Result of the request (result of the download will be posted to the onErrorEntityID once the operation is completed)
Example:
CODE
|
void setApiOptions(ZCBeans.ApiOptions options)
Defines the global options to be applied in subsequent zAgileConnect API calls in the current transaction
Parameters:
ZCBeans.ApiOptions options, object that holds the options
Example:
CODE
|
ZCBeans.TransitionIssueResult transitionIssue(String issueKey, ZCBeans.TransitionIssueBean transitionIssueBean)
Performs an Issue transition
Parameters:
IssueKey Issue Key
transitionIssueBean Transition and its fields and comment data
Return Value:
ZCBeans.TransitionIssueResult
Example:
CODE
|
ZCBeans.IssueLinkUnlinkResult unlinkIssue(String issueKey, Id entityId)
Unlink a JIRA Issue from a Salesforce entity.
Parameters:
String issueKey The JIRA issue key.
Id entityId The Salesforce entity Id.
Return Value:
The results of the Unlink operation.
Example:
CODE
|
List<ZCBeans.IssueLinkUnlinkResult> unlinkIssues(Set<String> selectedIssueKeys, Id entityId)
Unlink a list of JIRA Issues from a Salesforce entity.
Parameters:
Set<String> selectedIssueKeys The JIRA issues to be unlinked.
Id entityId The Salesforce entity Id.
Return Value:
List of results of the Unlink operation.
Example:
CODE
|
ZCBeans.IssueUpsertResult updateIssue(ZCBeans.IssueTemplate issue)
Update an issue from a template. This method must only be used for updating a single issue. For updating multiple issues, please refer to bulkUpdateIssues.
Parameters:
ZCBeans.IssueTemplate issue The issue template that represents the issue to be updated.
Return Value:
An object containing success or error list.
Example:
CODE
|
ZCBeans.IssueCommentResult updateJIRAIssueComment(String issueKeyOrId, String issueCommentId, String comment)
Update a JIRA Issue comment.
Parameters:
String issueKeyOrId The JIRA Issue key or Id.
String issueCommentId The Comment Id.
String comment: Comment body.
Return Value:
The result of the operation.
Example:
CODE
|
List<ZCBeans.IssueUpsertResult> validateAndSanitizeBulkCreateIssuesInput(List<ZCBeans.IssueTemplate> lstIssues)
Validates a list of issue templates to be created and sanitizes fields not referenced in the issue metadata.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be created.
Return Value:
A list of results for each template containing appropriate errors or warnings based on the validation.
Example:
CODE
|
List<ZCBeans.IssueUpsertResult> validateAndSanitizeBulkUpdateIssuesInput(List<ZCBeans.IssueTemplate> lstIssues)
Validates a list of issues templates to be updated. Sanitizes fields not referenced in the issue metadata.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be updated
Return Value:
A list of results for each template; each result may contain errors or warnings as a result of the validation.
Example:
CODE
|
List<ZCBeans.IssueUpsertResult> validateBulkCreateIssuesInput(List<ZCBeans.IssueTemplate> lstIssues)
Validates a list of issues templates to be created.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be created.
Return Value:
A list of results for each template containing errors based on the validation.
Example:
CODE
|
List<ZCBeans.IssueUpsertResult> validateBulkUpdateIssuesInput(List<ZCBeans.IssueTemplate> lstIssues)
Validates a list of issue templates to be updated.
Parameters:
List<ZCBeans.IssueTemplate> lstIssues List of templates representing the issues to be updated.
Return Value:
A list of results for each template, each result may contain errors as a result of the validation.
Example:
CODE
|
ZC.IssueFactory
Methods:
ZCBeans.IssueTemplate buildCreateTemplateFromMapping(Id entityId)
Builds an Issue template from an entity Id. The resulting template is populated based on the mapped fields.
Parameters:
Id entityId Entity from where it will extract the fields for building the issue template.
Return Value:
The template populated with the entity fields.
Example:
CODE
|
List<ZCBeans.IssueTemplate> buildCreateTemplateFromMapping(List<Id> entityIds)
Builds a list of templates from a list of entities. The returned list comprises of templates populated from their corresponding entities with the mapped fields.
Parameters:
List<Id> entityIds The list of entities from where it will extract fields for building the templates.
Return Value:
List of templates.
Example:
CODE
|
ZCBeans.IssueTemplate buildUpdateTemplateFromMapping(String issueKey)
Builds a template from an existent issue using fields from its related Salesforce parent object based on the configured field mapping.
Parameters:
String issueKey The JIRA issue that the method will use for building the template based on its related Salesforce parent object.
Return Value:
A template containing issue fields populated from the corresponding Salesforce parent object. The method returns null if the issue was not created from Salesforce.
Example:
CODE
|
List<ZCBeans.IssueTemplate> buildUpdateTemplateFromMapping(Set<String> issueKeys)
Builds a list of templates from a list of issues. The returned list comprises of templates populated with the mapped fields from the parent Salesforce objects.
Parameters:
Set<String> issueKeys Issue keys that the method will use for building the templates based on their corresponding Salesforce entities.
Return Value:
A list of templates containing issues populated with fields from the parent Salesforce objects. The method will not return templates for issues not created from Salesforce.
Example:
CODE
|