Program: 96975
Project: 96975
Buggy source:
private void addSawWorkTypes(){
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),"String_Node_Str");
  Artifact sawProgram=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Program);
  for (  DemoCsci csci : DemoCsci.values()) {
    sawProgram.addAttribute(AtsAttributeTypes.CSCI,csci.name());
  }
  sawProgram.persist(transaction);
  Artifact sawTeamDef=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_SW);
  for (  Artifact child : sawTeamDef.getChildren()) {
    child.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram.getUuid().intValue());
    if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Code.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Test.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Requirements.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.SW_Design.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Hardware.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
    child.persist(transaction);
  }
  Artifact sawTestAi=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Test_AI);
  sawTestAi.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram.getUuid().intValue());
  sawTestAi.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Test.name());
  sawTestAi.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
  sawTestAi.persist(transaction);
  Artifact sawCodeAi=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Code_AI);
  sawCodeAi.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram.getUuid().intValue());
  sawCodeAi.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Code.name());
  sawCodeAi.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
  sawCodeAi.persist(transaction);
  transaction.execute();
}

Fixed version (ground truth):
private void addSawWorkTypes(){
  SkynetTransaction transaction=TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),"String_Node_Str");
  Artifact sawProgram=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Program);
  for (  DemoCsci csci : DemoCsci.values()) {
    sawProgram.addAttribute(AtsAttributeTypes.CSCI,csci.name());
  }
  sawProgram.persist(transaction);
  Artifact sawTeamDef=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_SW);
  for (  Artifact child : sawTeamDef.getChildren()) {
    child.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram);
    if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Code.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Test.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Requirements.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.SW_Design.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
 else     if (child.getName().contains("String_Node_Str")) {
      child.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Hardware.name());
      child.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
    }
    child.persist(transaction);
  }
  Artifact sawTestAi=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Test_AI);
  sawTestAi.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram);
  sawTestAi.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Test.name());
  sawTestAi.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.DP.name());
  sawTestAi.persist(transaction);
  Artifact sawCodeAi=AtsClientService.get().getArtifact(DemoArtifactToken.SAW_Code_AI);
  sawCodeAi.setSoleAttributeValue(AtsAttributeTypes.ProgramUuid,sawProgram);
  sawCodeAi.setSoleAttributeValue(AtsAttributeTypes.WorkType,WorkType.Code.name());
  sawCodeAi.addAttribute(AtsAttributeTypes.CSCI,DemoCsci.SP.name());
  sawCodeAi.persist(transaction);
  transaction.execute();
}