Tabnine Logo
IssueLinkManager.getInwardLinks
Code IndexAdd Tabnine to your IDE (free)

How to use
getInwardLinks
method
in
com.atlassian.jira.issue.link.IssueLinkManager

Best Java code snippets using com.atlassian.jira.issue.link.IssueLinkManager.getInwardLinks (Showing top 8 results out of 315)

origin: com.atlassian.jira/jira-core

@Override
@Nullable
public Long getParentIssueId(Long issueId)
{
  if (issueId == null) return null;
  // Check if we have any incoming sub-task issue links
  final List<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(issueId);
  for (final IssueLink inwardLink : inwardLinks)
  {
    if (inwardLink.getIssueLinkType().isSubTaskLinkType())
    {
      return inwardLink.getSourceId();
    }
  }
  return null;
}
origin: com.atlassian.cpji/cpji-jira-plugin

public boolean isIssueWithLinks() {
  final MutableIssue issue = getMutableIssue();
  if (issueLinkManager.isLinkingEnabled()) {
    //checking if there are any not-subtask issue links (inward or outward)
    return Iterables.any(issueLinkManager.getOutwardLinks(issue.getId()), IssueLinkCopier.isNotSubtaskIssueLink)
        || Iterables.any(issueLinkManager.getInwardLinks(issue.getId()), IssueLinkCopier.isNotSubtaskIssueLink)
        || !remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue).isEmpty();
  }
  return false;
}
origin: com.atlassian.jira/jira-core

/**
 * We index the links in 3 ways. First, we index just the link type, so queries can be done like see if something is
 * a duplicate of another issue. Second, we index the link type with a direction flag which enables queries of all
 * issues that are blockers of other issues. Third, we link the link type plus direction plus the OTHER issue id so
 * that we can do a search like "all cloners of this issue" (or all cloners of other issues!).
 *
 * @param doc the lucene document that should be modified by adding relevant fields to.
 * @param issue the issue that contains the data that will be indexed and which can be used to determine the
 * project/issue type context that will allow you to determine if we should add the value as searchable
 */
public void addIndex(Document doc, Issue issue)
{
  Long issueId = issue.getId();
  addFieldsToDoc(doc, issueLinkManager.getInwardLinks(issueId), IN);
  addFieldsToDoc(doc, issueLinkManager.getOutwardLinks(issueId), OUT);
}
origin: com.atlassian.jira/jira-core

private boolean givenIssueHasAnyCopyableLink(Issue issue)
{
  Collection<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(issue.getId());
  if (hasAnyCopyableLinkInGivenLinks(inwardLinks))
  {
    return true;
  }
  Collection<IssueLink> outwardLinks = issueLinkManager.getOutwardLinks(issue.getId());
  if (hasAnyCopyableLinkInGivenLinks(outwardLinks))
  {
    return true;
  }
  return false;
}
origin: com.atlassian.cpji/cpji-jira-plugin

  public void copyLocalIssueLinks(final Issue localIssue, final String copiedIssueKey, final Long copiedIssueId) {

    //we throw out all subtask and cloner links before copying
    final Predicate<IssueLink> isNotSubtaskAndClonedLink = Predicates.and(isNotSubtaskIssueLink, isNotSpecifiedLinkType(clonerIssueLinkType));

    final Iterable<IssueLink> inwardLinks = Iterables.filter(issueLinkManager.getInwardLinks(localIssue.getId()), isNotSubtaskAndClonedLink);
    for (final IssueLink inwardLink : inwardLinks) {
      final IssueLinkType type = inwardLink.getIssueLinkType();
      remoteJira.copyLocalIssueLink(inwardLink.getSourceObject(), copiedIssueKey, copiedIssueId, type,
          JiraProxy.LinkCreationDirection.OUTWARD, JiraProxy.LinkCreationDirection.INWARD);
    }

    final Iterable<IssueLink> outwardLinks = Iterables.filter(issueLinkManager.getOutwardLinks(localIssue.getId()), isNotSubtaskAndClonedLink);
    for (final IssueLink outwardLink : outwardLinks) {

      final IssueLinkType type = outwardLink.getIssueLinkType();
      remoteJira.copyLocalIssueLink(outwardLink.getDestinationObject(), copiedIssueKey, copiedIssueId, type,
          JiraProxy.LinkCreationDirection.INWARD, JiraProxy.LinkCreationDirection.OUTWARD);
    }
  }
}
origin: com.atlassian.jira/jira-core

private void cloneLinksIfNeeded(Issue clone, Set<Long> originalIssueIdSet) throws CreateException
{
  if (isCloneLinks() && issueLinkManager.isLinkingEnabled())
  {
    Collection<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(originalIssue.getId());
    cloneInwardLinks(clone, originalIssueIdSet, inwardLinks);
    Collection<IssueLink> outwardLinks = issueLinkManager.getOutwardLinks(originalIssue.getId());
    cloneOutwardLinks(clone, originalIssueIdSet, outwardLinks);
    cloneRemoteIssueLinks(clone);
  }
}
origin: com.atlassian.jira/jira-core

/**
 * Removes the parent link and adds change item.
 *
 * @param context jira service context
 */
public void preStoreUpdates(JiraServiceContext context, IssueChangeHolder changeHolder, Issue currentIssue, MutableIssue targetIssue)
{
  Collection<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(currentIssue.getId());
  for (final IssueLink issueLink : inwardLinks)
  {
    if (issueLink.getIssueLinkType().isSubTaskLinkType())
    {
      issueLinkManager.removeIssueLink(issueLink, context.getLoggedInUser());
    }
  }
  // need to reorder sequence.
  subTaskManager.resetSequences(currentIssue.getParentObject());
  final Issue parentIssue = currentIssue.getParentObject();
  changeHolder.addChangeItem(new ChangeItemBean(ChangeItemBean.STATIC_FIELD, "Parent", parentIssue.getId().toString(), parentIssue.getKey(), null, null));
}
origin: com.atlassian.jira/jira-core

Collection<IssueLink> inwardLinks = issueLinkManager.getInwardLinks(subTask.getId());
for (final IssueLink issueLink : inwardLinks)
com.atlassian.jira.issue.linkIssueLinkManagergetInwardLinks

Javadoc

Get links to an issue.

Popular methods of IssueLinkManager

  • createIssueLink
    Constructs a new issuelink from the sourceIssueId to the destinationId and persists it. This operati
  • getIssueLink
    Retrieves an issue link given a source, destination and a link type.
  • isLinkingEnabled
    Returns whether Issue Linking is currently enabled in JIRA. Issue Linking can be enabled or disabled
  • getLinkCollection
    Constructs a LinkCollection for a given issue.
  • getOutwardLinks
    Get links from an issue.
  • changeIssueLinkType
    Changes the type of an issue link.NOTE: It is not possible to convert a system link type to a non-sy
  • clearCache
    Clears the Issue Link cache used by the Issue Link Manager.
  • getIssueLinks
    Returns a collection of all IssueLinks for a particular issue link type
  • getLinkCollectionOverrideSecurity
    Constructs a LinkCollection for a given issue, ignoring security.
  • moveIssueLink
    Moves an issue link to a different position in the list of issuelink.NOTE: This is currently only us
  • removeIssueLink
    Removes a single issue link We do not check for permission here. It should be done before this metho
  • removeIssueLinksNoChangeItems
    Removes ALL incoming and outgoing issuelinks from the issue supplied without creating ChangeItems fo
  • removeIssueLink,
  • removeIssueLinksNoChangeItems,
  • resetSequences

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Runner (org.openjdk.jmh.runner)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now