• Eesha Huria
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Here i have hard coded few things as my initial requirement i just wanted to create a Work Record (Bug Type) in Agile Accelerator when a Case is created. I am able to do so with the below code however not able to attach case and bug. Please find below class code and method.Any help would be highly appreciated.
public class CaseTriggerHelperClass {
    public static void isAfterInsert(Map<Id,case> casemap)
      {
       Id RecordTypeId1 = '01228000000YbH3';
   
    for(Id I : casemap.keyset()){              
         agf__ADM_Work__c aw = new agf__ADM_Work__c();         
         aw.RecordTypeId = RecordTypeId1;
         aw.agf__Subject__c = casemap.get(I).Subject;
         aw.agf__Details_and_Steps_to_Reproduce__c = casemap.get(I).Description;
         aw.agf__Product_Tag__c = 'a0f28000000DAywAAG';
         aw.agf__Found_in_Build__c = 'a0E28000001hCTk';
         aw.agf__Impact__c = 'a0X28000000Hcjf';
         aw.agf__Frequency__c = 'a0T28000000LpJj';
         aw.agf__Priority__c = casemap.get(I).Priority;
         aw.agf__Type__c = '00N28000003qlBQ';
        insert aw;
        
      }
          
   }

}
trigger Link2Agile1 on Case (before Insert, after insert, before update) {

      if(trigger.isAfter && Trigger.isinsert)
      {
              CaseTriggerHelperClass.isAfterInsert(trigger.newmap);
      }
Where in Agile Accelerator It Should Show