Codota Logo
RemoteIssueLinkService$CreateValidationResult
Code IndexAdd Codota to your IDE (free)

How to use
RemoteIssueLinkService$CreateValidationResult
in
com.atlassian.jira.bc.issue.link

Best Java code snippets using com.atlassian.jira.bc.issue.link.RemoteIssueLinkService$CreateValidationResult (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: com.atlassian.jira/jira-rest-plugin

/**
 * Creates a remote issue link.
 *
 * @param issue the issue to create the link with
 * @param request the request, containing the values of the remote issue link to be created
 * @param contextUriInfo uri context, for building the self link
 * @return a Response containing a RemoteIssueLinkCreateOrUpdateResponse, or the error details if something went wrong
 */
private Response createRemoteIssueLink(final Issue issue, final RemoteIssueLinkCreateOrUpdateRequest request, final ContextUriInfo contextUriInfo)
{
  final RemoteIssueLink remoteIssueLink = buildRemoteIssueLink(issue.getId(), request);
  final ApplicationUser user = callingUser();
  final CreateValidationResult validationResult = remoteIssueLinkService.validateCreate(user, remoteIssueLink);
  if (!validationResult.isValid())
  {
    throw new RESTException(ErrorCollection.of(validationResult.getErrorCollection()));
  }
  final RemoteIssueLinkResult result = remoteIssueLinkService.create(user, validationResult);
  if (!result.isValid())
  {
    throw new RESTException(ErrorCollection.of(validationResult.getErrorCollection()));
  }
  final URI self = RemoteIssueLinkBeanBuilder.createSelfLink(result.getRemoteIssueLink(), issue, contextUriInfo);
  final RemoteIssueLinkCreateOrUpdateResponse response = newCreateOrUpdateResponse(result.getRemoteIssueLink(), self);
  return status(CREATED).location(self).entity(response).build();
}
origin: com.atlassian.jira/jira-core

@Override
public RemoteIssueLinkResult create(final ApplicationUser user, final CreateValidationResult createValidationResult)
{
  if (createValidationResult == null)
  {
    throw new IllegalArgumentException("You cannot create a remote issue link with a null validation result.");
  }
  if (!createValidationResult.isValid())
  {
    throw new IllegalStateException("You cannot create a remote issue link with an invalid validation result.");
  }
  final RemoteIssueLink remoteIssueLink = createValidationResult.getRemoteIssueLink();
  if (remoteIssueLink == null)
  {
    throw new IllegalArgumentException("You cannot create a null remote issue link.");
  }
  final ErrorCollection errors = new SimpleErrorCollection();
  RemoteIssueLink createdRemoteIssueLink = null;
  try
  {
    createdRemoteIssueLink = remoteIssueLinkManager.createRemoteIssueLink(remoteIssueLink, user);
  }
  catch (final CreateException e)
  {
    handleCreateException(getI18n(user), errors, e);
  }
  return new RemoteIssueLinkResult(createdRemoteIssueLink, errors);
}
origin: com.atlassian.jira/jira-issue-link-remote-jira-plugin

private CreateValidationResult validateCreateRemote(final RemoteJiraIssue remoteJiraIssue)
{
  final String globalId = RemoteJiraGlobalIdFactoryImpl.encode(new RemoteJiraGlobalId(getJiraAppLink(), remoteJiraIssue.getId()));
  // Only store the bare minimum information, the rest will be shown using the renderer plugin
  final RemoteIssueLink remoteIssueLink = new RemoteIssueLinkBuilder()
      .url(remoteJiraIssue.getBrowseUrl())
      .title(remoteJiraIssue.getKey())
      .globalId(globalId)
      .issueId(id)
      .relationship(linkDesc)
      .applicationName(getJiraAppLink().getName())
      .applicationType(RemoteIssueLink.APPLICATION_TYPE_JIRA)
      .build();
  final CreateValidationResult validationResult = remoteIssueLinkService.validateCreate(getLoggedInUser(), remoteIssueLink);
  if (!validationResult.isValid())
  {
    mapErrors(validationResult.getErrorCollection());
    addErrorCollection(validationResult.getErrorCollection());
  }
  return validationResult;
}
origin: com.atlassian.cpji/cpji-jira-plugin

public void createLinkToRemoteIssue(final Issue localIssue, final ApplicationLink applicationLink, final String remoteIssueKey, final Long remoteIssueId, final String relationship)
{
  final String globalId = encodeGlobalId(applicationLink.getId(), remoteIssueId);
  final String url = buildIssueUrl(applicationLink.getDisplayUrl().toASCIIString(), remoteIssueKey);
  final RemoteIssueLink remoteIssueLink = new RemoteIssueLinkBuilder()
      .globalId(globalId)
      .applicationType(RemoteIssueLink.APPLICATION_TYPE_JIRA)
      .relationship(relationship)
      .url(url)
      .applicationName(applicationLink.getName())
      .issueId(localIssue.getId())
      .title(remoteIssueKey)
      .build();
  final ApplicationUser user = callingUser();
  final RemoteIssueLinkService.CreateValidationResult issueLinkValidationResult = remoteIssueLinkService.validateCreate(user, remoteIssueLink);
  if (issueLinkValidationResult.isValid())
  {
    final RemoteIssueLinkService.RemoteIssueLinkResult remoteIssueLinkResult = remoteIssueLinkService.create(user, issueLinkValidationResult);
  }
  else
  {
    log.error("Failed to create issue link to remote JIRA issue with key '" + remoteIssueKey + "' Error(s): " + issueLinkValidationResult.getErrorCollection());
  }
}
origin: com.atlassian.jira/jira-core

@Override
public CreateValidationResult validateCreate(final ApplicationUser user, final RemoteIssueLink remoteIssueLink)
{
  final ErrorCollection errors = new SimpleErrorCollection();
  final I18nHelper i18n = getI18n(user);
  validateLinkingEnabled(i18n, errors);
  Issue issue = null;
  if (!errors.hasAnyErrors())
  {
    issue = validateIssueExists(remoteIssueLink, errors, i18n);
  }
  if (!errors.hasAnyErrors())
  {
    validatePermissionToCreate(user, issue, errors, i18n);
  }
  if (!errors.hasAnyErrors())
  {
    validateMandatoryFields(remoteIssueLink, i18n, errors);
    validateFieldLengths(remoteIssueLink, i18n, errors);
    validateUrls(remoteIssueLink, i18n, errors);
    validateGlobalId(remoteIssueLink, issue, errors, i18n);
  }
  return new CreateValidationResult((errors.hasAnyErrors() ? null : remoteIssueLink), errors);
}
origin: com.atlassian.jira/jira-issue-link-confluence-plugin

protected void doValidation()
{
  super.doValidation();
  validateUrl(pageUrl);
  if (hasAnyErrors())
  {
    return;
  }
  pageUrl = ConfluencePageUrl.build(pageUrl, appLink).getUrlRebasedToRpcUrl();
  String pageId = getPageId(pageUrl, appLink);
  if (!hasAnyErrors())
  {
    if (pageId == null)
    {
      addErrorMessage(getText("addconfluencelink.error.pageid.notfound"));
    }
  }
  if (!hasAnyErrors())
  {
    RemoteIssueLink remoteIssueLink = new ConfluenceRemoteIssueLinkBuilder().build(appLink, pageId, getIssue().getLong("id"));
    validationResult = remoteIssueLinkService.validateCreate(getLoggedInUser(), remoteIssueLink);
    if (!validationResult.isValid())
    {
      mapErrors(validationResult.getErrorCollection());
      addErrorCollection(validationResult.getErrorCollection());
    }
  }
}
com.atlassian.jira.bc.issue.linkRemoteIssueLinkService$CreateValidationResult

Javadoc

Holds the information about validating a create remote issue link operation. This object should not be constructed directly, you should invoke the #validateCreate(User,RemoteIssueLink)method to obtain this.

Most used methods

  • isValid
  • getErrorCollection
  • <init>
  • getRemoteIssueLink

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setContentView (Activity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now