@Override public void createSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser) throws CreateException { if (parentIssue == null) { throw new IllegalArgumentException("Parent Issue cannot be null."); } else if (subTaskIssue == null) { throw new IllegalArgumentException("Sub-Task Issue cannot be null."); } // Determine the next sequence of the issue final Collection subTaskIssueLinks = getSubTaskIssueLinks(parentIssue.getId()); // Determine the sequence of the new sub-task link final long sequence = subTaskIssueLinks == null ? 0 : subTaskIssueLinks.size(); issueLinkManager.createIssueLink(parentIssue.getId(), subTaskIssue.getId(), getSubTaskIssueLinkType().getId(), sequence, remoteUser); }
@Override public Either<NegativeResponseStatus, SuccessfulResponse> copyLocalIssueLink(Issue localIssue, String remoteIssueKey, Long remoteIssueId, SimplifiedIssueLinkType issueLinkType, LinkCreationDirection localDirection, LinkCreationDirection remoteDirection) { try { //In contrary to remote links, local are always created in both directions so is is not possible to create only one-way local link. //So here we care only local direction (ie creating link from source issue) if (localDirection == LinkCreationDirection.OUTWARD) { issueLinkManager.createIssueLink(localIssue.getId(), remoteIssueId, issueLinkType.getId(), null, jiraAuthenticationContext.getLoggedInUser()); } else if (localDirection == LinkCreationDirection.INWARD) { issueLinkManager.createIssueLink(remoteIssueId, localIssue.getId(), issueLinkType.getId(), null, jiraAuthenticationContext.getLoggedInUser()); } return SuccessfulResponse.buildEither(jiraLocation); } catch (CreateException e) { return Either.left(NegativeResponseStatus.errorOccured(jiraLocation, e.getMessage())); } }
private void createLocalLink(final IssueLinkType linkType, final MutableIssue destinationIssue) { try { if (linkDesc.equals(linkType.getOutward())) { issueLinkManager.createIssueLink(getIssue().getLong("id"), destinationIssue.getId(), linkType.getId(), null, getLoggedInUser()); } else { issueLinkManager.createIssueLink(destinationIssue.getId(), getIssue().getLong("id"), linkType.getId(), null, getLoggedInUser()); } } catch (Exception e) { log.error("Error occurred creating link: " + e, e); addErrorMessage(getText("admin.errors.issues.an.error.occured", e)); } }
private void linkIssue(IssueLinkType linkType, MutableIssue destinationIssue) { try { if (linkDesc.equals(linkType.getOutward())) { issueLinkManager.createIssueLink(getIssue().getLong("id"), destinationIssue.getId(), linkType.getId(), null, getLoggedInUser()); } else { issueLinkManager.createIssueLink(destinationIssue.getId(), getIssue().getLong("id"), linkType.getId(), null, getLoggedInUser()); } userHistoryManager.addItemToHistory(ISSUELINKTYPE, getLoggedInUser(), valueOf(linkType.getId()), linkDesc); } catch (Exception e) { log.error("Error occurred creating link: " + e, e); addErrorMessage(getText("admin.errors.issues.an.error.occured", e)); } }
issueLinkManager.createIssueLink(workingIssueId, cloneIssue.getId(), issueLink.getIssueLinkType().getId(), null, getLoggedInUser()); issueLinkManager.createIssueLink(cloneIssue.getId(), workingIssueId, issueLink.getIssueLinkType().getId(), null, getLoggedInUser());
private void linkCloningIssueToOriginalOne(final Issue cloneIssue) throws CreateException { // Record the mapping from old ID to new ID newIssueIdMap.put(getOriginalIssue().getId(), cloneIssue.getId()); // Create link between the cloned issue and the original - sequence on links does not matter. final IssueLinkType cloneIssueLinkType = getCloneIssueLinkType(); if (cloneIssueLinkType != null) { issueLinkManager.createIssueLink(getIssue().getLong("id"), getOriginalIssue().getId(), cloneIssueLinkType.getId(), null, getLoggedInUser()); } }
issueLinkManager.createIssueLink(sourceIssue.getId(), destinationIssue.getId(), linkType.getId(), null, result.getUser()); issueLinkManager.createIssueLink(destinationIssue.getId(), sourceIssue.getId(), linkType.getId(), null, result.getUser());
try issueLinkManager.createIssueLink(inwardIssue.getId(), outwardIssue.getId(), linkType.getId(), null, authContext.getUser()); issueLinkId = issueLinkManager.getIssueLink(inwardIssue.getId(), outwardIssue.getId(), linkType.getId()).getId();