Codota Logo
WorklogService.validateCreate
Code IndexAdd Codota to your IDE (free)

How to use
validateCreate
method
in
com.atlassian.jira.bc.issue.worklog.WorklogService

Best Java code snippets using com.atlassian.jira.bc.issue.worklog.WorklogService.validateCreate (Showing top 8 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

@Override
public Worklog validateAndPerformAndLeaveEstimate(JiraServiceContext serviceContext, Issue issue, WorklogInputParameters worklogInputParameters)
{
  WorklogResult worklogResult = getWorklogService().validateCreate(serviceContext, worklogInputParameters);
  return getWorklogService().createAndRetainRemainingEstimate(serviceContext, worklogResult, true);
}
origin: com.atlassian.jira/jira-core

worklogResult = worklogService.validateCreate(getJiraServiceContext(), params);
origin: com.atlassian.jira/jira-core

worklogResult = getWorklogService().validateCreate(jiraServiceContext, inputBuilder.build());
origin: com.atlassian.jira/jira-rest-plugin

@Override
public Worklog validateAndPerformAndAutoAdjustEstimate(JiraServiceContext serviceContext, Issue issue, WorklogInputParameters worklogInputParameters)
{
  WorklogResult worklogResult = getWorklogService().validateCreate(serviceContext, worklogInputParameters);
  return getWorklogService().createAndAutoAdjustRemainingEstimate(serviceContext, worklogResult, true);
}
origin: com.atlassian.studio/studio-jira-fisheye-plugin

  /**
   * Handle a commit comment command
   *
   * @param ctx The context
   * @param issue The issue the command is for
   * @param command The command word, as entered by the user
   * @param arguments The arguments supplied to the command
   */
  public void handle(JiraServiceContext ctx, MutableIssue issue, String command, String arguments)
  {
    Matcher matcher = timePattern.matcher(arguments);
    if (matcher.find())
    {
      String timeLogged = matcher.group(1);
      String comment = matcher.group(2);
      // We need to instantiate a new ctx with a new error collection, because the ctx we were passed might
      // already have errors in it, and so we won't know if the errors in it are from this validation or not
      JiraServiceContext tmpCtx = new JiraServiceContextImpl(ctx.getUser());
      Worklog worklog = worklogService.validateCreate(tmpCtx, issue, timeLogged, new Date(), comment,
        null, null);
      // Check that there are no errors
      if (!tmpCtx.getErrorCollection().hasAnyErrors())
      {
        worklogService.createAndAutoAdjustRemainingEstimate(tmpCtx, worklog, true);
      }
      ctx.getErrorCollection().addErrorCollection(tmpCtx.getErrorCollection());
    }
  }
}
origin: com.atlassian.jira.plugins/jira-fisheye-plugin

  public Either<CommitHookErrors, Worklog> handle(ApplicationUser user, MutableIssue issue, String commandName, List<String> args) {
    JiraServiceContextImpl jiraServiceContext = new JiraServiceContextImpl(user);
    WorklogResult result = worklogService.validateCreate(
        jiraServiceContext,
        WorklogInputParametersImpl.builder()
            .issue(issue)
            .timeSpent(args.isEmpty() ? null : args.get(0))
            .comment(args.size() > 1 ? args.get(1) : null)
            .startDate(new Date())
            .build());
    if (!jiraServiceContext.getErrorCollection().hasAnyErrors()) {
      return Either.value(worklogService.createAndAutoAdjustRemainingEstimate(
          jiraServiceContext, result, true));
    } else {
      return Either.error(CommitHookErrors.fromErrorCollection(
          CMD_TYPE.getName(), issue.getKey(), jiraServiceContext.getErrorCollection()));
    }
  }
}
origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

public RemoteWorklog addWorklogAndAutoAdjustRemainingEstimate(final User user, final String issueKey, final RemoteWorklog remoteWorklog)
    throws RemoteException, RemotePermissionException, RemoteValidationException
{
  JiraServiceContext serviceContext = new JiraServiceContextImpl(user, new SimpleErrorCollection());
  Issue issue = getIssueFromKey(issueKey);
  String timeSpent = remoteWorklog.getTimeSpent();
  Date startDate = remoteWorklog.getStartDate();
  String comment = remoteWorklog.getComment();
  String groupLevel = remoteWorklog.getGroupLevel();
  String roleLevelId = remoteWorklog.getRoleLevelId();
  WorklogInputParameters params = WorklogInputParametersImpl
      .issue(issue)
      .timeSpent(timeSpent)
      .startDate(startDate)
      .comment(comment)
      .groupLevel(groupLevel)
      .roleLevelId(roleLevelId)
      .build();
  WorklogResult worklogResult = worklogService.validateCreate(serviceContext, params);
  checkAndThrowValidationException(serviceContext.getErrorCollection());
  if (worklogResult == null)
  {
    throw new RemoteValidationException(getI18nHelper().getText("error.unexpected.condition", "WorklogService.validateCreate"));
  }
  Worklog createdWorklog = worklogService.createAndAutoAdjustRemainingEstimate(serviceContext, worklogResult, true);
  checkAndThrowRemoteException(serviceContext.getErrorCollection());
  return RemoteWorklogImpl.copyToRemoteWorkLog(createdWorklog, getJiraDurationUtils());
}
origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

public RemoteWorklog addWorklogAndRetainRemainingEstimate(final User user, final String issueKey, final RemoteWorklog remoteWorklog)
    throws RemoteException, RemotePermissionException, RemoteValidationException
{
  JiraServiceContext serviceContext = new JiraServiceContextImpl(user, new SimpleErrorCollection());
  Issue issue = getIssueFromKey(issueKey);
  String timeSpent = remoteWorklog.getTimeSpent();
  Date startDate = remoteWorklog.getStartDate();
  String comment = remoteWorklog.getComment();
  String groupLevel = remoteWorklog.getGroupLevel();
  String roleLevelId = remoteWorklog.getRoleLevelId();
  WorklogInputParameters params = WorklogInputParametersImpl
      .issue(issue)
      .timeSpent(timeSpent)
      .startDate(startDate)
      .comment(comment)
      .groupLevel(groupLevel)
      .roleLevelId(roleLevelId)
      .build();
  WorklogResult worklogResult = worklogService.validateCreate(serviceContext, params);
  checkAndThrowValidationException(serviceContext.getErrorCollection());
  if (worklogResult == null)
  {
    throw new RemoteValidationException(getI18nHelper().getText("error.unexpected.condition", "WorklogService.validateCreate"));
  }
  Worklog createdWorklog = worklogService.createAndRetainRemainingEstimate(serviceContext, worklogResult, true);
  checkAndThrowRemoteException(serviceContext.getErrorCollection());
  return RemoteWorklogImpl.copyToRemoteWorkLog(createdWorklog, getJiraDurationUtils());
}
com.atlassian.jira.bc.issue.worklogWorklogServicevalidateCreate

Javadoc

Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling #hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue,boolean)to create a worklog for this issue.

Popular methods of WorklogService

  • createAndAutoAdjustRemainingEstimate
  • getById
    Used to get a worklog by its id.
  • createAndRetainRemainingEstimate
    Persists a new com.atlassian.jira.issue.worklog.Worklog on the given Issue. This method will make no
  • createWithNewRemainingEstimate
    Persists a new com.atlassian.jira.issue.worklog.Worklog on the given Issue. This method will adjust
  • deleteAndAutoAdjustRemainingEstimate
    Deletes the specified com.atlassian.jira.issue.worklog.Worklog. This method will auto-adjust the iss
  • deleteAndRetainRemainingEstimate
    Deletes the specified com.atlassian.jira.issue.worklog.Worklog. This method will make no adjustment
  • deleteWithNewRemainingEstimate
    Deletes the specified com.atlassian.jira.issue.worklog.Worklog. This method will adjust the issues r
  • getByIssueVisibleToUser
    Returns a PagedList over all all child worklogs of a specified issue that the provided user has perm
  • updateAndAutoAdjustRemainingEstimate
    Updates the provided com.atlassian.jira.issue.worklog.Worklog. This method will auto-adjust the issu
  • updateAndRetainRemainingEstimate
    Updates the provided com.atlassian.jira.issue.worklog.Worklog. This method will make no adjustment t
  • updateWithNewRemainingEstimate
    Updates the provided com.atlassian.jira.issue.worklog.Worklog. This method will adjust the issues re
  • validateCreateWithNewEstimate
    Determines whether worklogs are enabled in JIRA and if the user has the required permission as deter
  • updateWithNewRemainingEstimate,
  • validateCreateWithNewEstimate,
  • validateDelete,
  • validateDeleteWithNewEstimate,
  • validateUpdate,
  • validateUpdateWithNewEstimate,
  • createWithManuallyAdjustedEstimate,
  • deleteWithManuallyAdjustedEstimate,
  • hasPermissionToDelete

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
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