Tabnine Logo
IssueFieldsSetter.setNewAssignee
Code IndexAdd Tabnine to your IDE (free)

How to use
setNewAssignee
method
in
org.sonar.server.issue.IssueFieldsSetter

Best Java code snippets using org.sonar.server.issue.IssueFieldsSetter.setNewAssignee (Showing top 5 results out of 315)

origin: SonarSource/sonarqube

@Override
public void onIssue(Component component, DefaultIssue issue) {
 if (issue.authorLogin() != null) {
  return;
 }
 loadScmChangesets(component);
 Optional<String> scmAuthor = guessScmAuthor(issue, component);
 if (scmAuthor.isPresent()) {
  if (scmAuthor.get().length() <= IssueDto.AUTHOR_MAX_SIZE) {
   issueUpdater.setNewAuthor(issue, scmAuthor.get(), changeContext);
  } else {
   LOGGER.debug("SCM account '{}' is too long to be stored as issue author", scmAuthor.get());
  }
 }
 if (issue.assignee() == null) {
  String assigneeUuid = scmAuthor.map(scmAccountToUser::getNullable).orElse(null);
  assigneeUuid = defaultIfEmpty(assigneeUuid, defaultAssignee.loadDefaultAssigneeUuid());
  issueUpdater.setNewAssignee(issue, assigneeUuid, changeContext);
 }
}
origin: SonarSource/sonarqube

@Test
public void not_set_new_assignee_if_new_assignee_is_null() {
 boolean updated = underTest.setNewAssignee(issue, null, context);
 assertThat(updated).isFalse();
 assertThat(issue.currentChange()).isNull();
 assertThat(issue.mustSendNotifications()).isFalse();
}
origin: SonarSource/sonarqube

@Test
public void set_new_assignee() {
 boolean updated = underTest.setNewAssignee(issue, "user_uuid", context);
 assertThat(updated).isTrue();
 assertThat(issue.assignee()).isEqualTo("user_uuid");
 assertThat(issue.mustSendNotifications()).isTrue();
 FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
 assertThat(diff.oldValue()).isEqualTo(UNUSED);
 assertThat(diff.newValue()).isEqualTo("user_uuid");
}
origin: SonarSource/sonarqube

@Test
public void fail_with_ISE_when_setting_new_assignee_on_already_assigned_issue() {
 issue.setAssigneeUuid("user_uuid");
 thrown.expect(IllegalStateException.class);
 thrown.expectMessage("It's not possible to update the assignee with this method, please use assign()");
 underTest.setNewAssignee(issue, "another_user_uuid", context);
}
origin: org.sonarsource.sonarqube/sonar-server

@Override
public void onIssue(Component component, DefaultIssue issue) {
 if (issue.authorLogin() == null) {
  loadScmChangesets(component);
  String scmAuthor = guessScmAuthor(issue);
  if (!isNullOrEmpty(scmAuthor)) {
   if (scmAuthor.length() <= IssueDto.AUTHOR_MAX_SIZE) {
    issueUpdater.setNewAuthor(issue, scmAuthor, changeContext);
   } else {
    LOGGER.debug("SCM account '{}' is too long to be stored as issue author", scmAuthor);
   }
  }
  if (issue.assignee() == null) {
   String assigneeUuid = isNullOrEmpty(scmAuthor) ? null : scmAccountToUser.getNullable(scmAuthor);
   assigneeUuid = defaultIfEmpty(assigneeUuid, defaultAssignee.loadDefaultAssigneeUuid());
   issueUpdater.setNewAssignee(issue, assigneeUuid, changeContext);
  }
 }
}
org.sonar.server.issueIssueFieldsSettersetNewAssignee

Javadoc

Used to set the assignee when it was null

Popular methods of IssueFieldsSetter

  • assign
  • setResolution
  • setStatus
  • setType
  • setMessage
  • setPastEffort
  • setPastLine
  • setPastMessage
  • setPastSeverity
  • setSeverity
  • addComment
  • setCreationDate
  • addComment,
  • setCreationDate,
  • setGap,
  • setIssueMoved,
  • setLocations,
  • setManualSeverity,
  • setNewAuthor,
  • setPastGap,
  • setPastLocations

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • CodeWhisperer alternatives
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