Program: 97422
Project: 97422
Buggy source:
private static ActionArtifact sawBuild2Action1_createCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
  String title="String_Node_Str";
  Collection<IAtsActionableItem> aias=DemoDbUtil.getActionableItems(new String[]{DemoDbAIs.SAW_Requirements.getAIName(),DemoDbAIs.SAW_Code.getAIName(),DemoDbAIs.SAW_Test.getAIName()});
  Date createdDate=new Date();
  IAtsUser createdBy=AtsUsersClient.getUser();
  String priority="String_Node_Str";
  ActionArtifact actionArt=ActionManager.createAction(null,title,"String_Node_Str",ChangeType.Problem,priority,false,null,aias,createdDate,createdBy,null,transaction);
  for (  TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
    if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
    TeamWorkFlowManager dtwm=new TeamWorkFlowManager(teamWf,TransitionOption.OverrideAssigneeCheck,TransitionOption.OverrideTransitionValidityCheck);
    Result result=dtwm.transitionTo(toState,teamWf.getAssignees().iterator().next(),false,transaction);
    if (result.isFalse()) {
      throw new OseeCoreException("String_Node_Str",teamWf.toStringWithId(),toState.getName(),result.getText());
    }
    if (!teamWf.isCompletedOrCancelled()) {
      teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
    }
    teamWf.persist(transaction);
    AtsVersionService.get().setTargetedVersionAndStore(teamWf,version);
    teamWf.persist(transaction);
  }
  return actionArt;
}

Fixed version (ground truth):
private static ActionArtifact sawBuild2Action1_createCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
  String title="String_Node_Str";
  Collection<IAtsActionableItem> aias=DemoDbUtil.getActionableItems(new String[]{DemoDbAIs.SAW_Requirements.getAIName(),DemoDbAIs.SAW_Code.getAIName(),DemoDbAIs.SAW_Test.getAIName()});
  Date createdDate=new Date();
  IAtsUser createdBy=AtsClientService.get().getUserAdmin().getCurrentUser();
  String priority="String_Node_Str";
  ActionArtifact actionArt=ActionManager.createAction(null,title,"String_Node_Str",ChangeType.Problem,priority,false,null,aias,createdDate,createdBy,null,transaction);
  for (  TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
    if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
 else     if (teamWf.getTeamDefinition().getName().contains("String_Node_Str") && !teamWf.getWorkDefinition().getName().equals("String_Node_Str")) {
      throw new OseeCoreException("String_Node_Str",teamWf.getWorkDefinition().getName());
    }
    TeamWorkFlowManager dtwm=new TeamWorkFlowManager(teamWf,TransitionOption.OverrideAssigneeCheck,TransitionOption.OverrideTransitionValidityCheck);
    Result result=dtwm.transitionTo(toState,teamWf.getAssignees().iterator().next(),false,transaction);
    if (result.isFalse()) {
      throw new OseeCoreException("String_Node_Str",teamWf.toStringWithId(),toState.getName(),result.getText());
    }
    if (!teamWf.isCompletedOrCancelled()) {
      teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
    }
    teamWf.persist(transaction);
    AtsVersionService.get().setTargetedVersionAndStore(teamWf,version);
    teamWf.persist(transaction);
  }
  return actionArt;
}