/** * Checks if this link's type is a System Link type. A System Link Type is a link type * that is used by JIRA to denote special relationships. For example, a sub-task is linked to its * parent issue using a link type that is a System Link Type. */ public boolean isSystemLink() { return getIssueLinkType().isSystemLinkType(); }
@Override public List<RemoteIssueLink> findRemoteIssueLinksByGlobalIds(final Collection<String> globalIds) throws GetException { validateGlobalIdsForGet(globalIds); return remoteIssueLinkStore.findRemoteIssueLinksByGlobalIds(globalIds); }
public IssueLinkType getIssueLinkType() { if (issueLinkType == null) { issueLinkType = issueLinkTypeManager.getIssueLinkType(getLinkTypeId()); } return issueLinkType; }
@Override public RemoteIssueLink createRemoteIssueLink(RemoteIssueLink remoteIssueLink) { final RemoteIssueLink linkToStore = createBuilder(remoteIssueLink).id(getNextId()).build(); remoteIssueLinks.put(linkToStore.getId(), linkToStore); return linkToStore; }
public AbstractRemoteIssueLinkEvent(RemoteIssueLink remoteIssueLink) { this.remoteIssueLinkId = remoteIssueLink.getId(); this.globalId = remoteIssueLink.getGlobalId(); }
public String getDirectionName() throws GenericEntityException { if (destId != null) { return getLink().getIssueLinkType().getOutward(); } else if (sourceId != null) { return getLink().getIssueLinkType().getInward(); } return null; }
/** * @return the directional name. */ public String getLinkName() { return direction == Direction.OUT ? linkType.getOutward() : linkType.getInward(); }
public RemoteIssueLinkUICreateEvent(RemoteIssueLink remoteIssueLink) { super(remoteIssueLink); this.applicationType = remoteIssueLink.getApplicationType(); }
@Override public Long apply(final RemoteIssueLink remoteIssueLink) { return remoteIssueLink.getIssueId(); } });
@Override public IssueLink getIssueLink(Long sourceId, Long destinationId, Long issueLinkTypeId) { return issueLinkManager.getIssueLink(sourceId, destinationId, issueLinkTypeId); }
private void validateUrlsForUpdate(final RemoteIssueLink remoteIssueLink) throws UpdateException { final Result result = validateUrls(remoteIssueLink); if (!result.isValid()) { throw new UpdateException(result.getMessage()); } }
private Result validateGlobalId(final Issue issue, final String globalId) { if (globalId == null) { return TRUE; } // Check for duplicate globalId on this issue if (getRemoteIssueLinkByGlobalId(issue, globalId) != null) { return new Result(false, "A remote issue link already exists on this issue with the globalId '" + globalId + "'"); } return TRUE; }
@Override public void removeRemoteIssueLink(final Long remoteIssueLinkId, final ApplicationUser user) { // Make sure remote issue link exists final RemoteIssueLink remoteIssueLink = getRemoteIssueLink(remoteIssueLinkId); if (remoteIssueLink == null) { // Nothing to do return; } removeRemoteIssueLink(remoteIssueLink, user); }
@Override public boolean evaluate(final IssueLinkType type) { return !type.isSystemLinkType(); } });
public Collection<IssueLinkType> getIssueLinkTypesByOutwardDescription(final String desc) { final Predicate<GenericValue> inwardNamePredicate = new Predicate<GenericValue>() { public boolean evaluate(final GenericValue input) { return input.getString(IssueLinkType.OUTWARD_FIELD_NAME).equalsIgnoreCase(desc); } }; return getIssueLinkTypesByPredicate(inwardNamePredicate); }
private void deleteIssueLinksFromIssue(List<IssueLink> issueLinks, ApplicationUser remoteUser, boolean createChangeItem) { if (issueLinks != null) { for (final IssueLink issueLink : issueLinks) { removeIssueLinkInternal(issueLink, remoteUser, createChangeItem); } } }
@Override public List<RemoteIssueLink> getRemoteIssueLinksForIssue(final Issue issue) { return remoteIssueLinkStore.getRemoteIssueLinksForIssue(issue); }
@Override public long getTotalRemoteIssueLinkCountByGlobalId(final String globalId) { return remoteIssueLinkStore.getTotalRemoteIssueLinkCountByGlobalId(globalId); }
@Override public RemoteIssueLink getRemoteIssueLink(final Long remoteIssueLinkId) { return remoteIssueLinkStore.getRemoteIssueLink(remoteIssueLinkId); }
public RemoteIssueLinkCreateEvent(RemoteIssueLink remoteIssueLink) { super(remoteIssueLink); this.applicationType = remoteIssueLink.getApplicationType(); }