function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew KingAndrew King 

Failed Component Deployment: ChatterAnswersEscalationTriggerTest.validateQuestionEscalation(), MyProfilePageControllerTest.testSave(), chatter_answers_question_escalation_to_case_trigger

Trying to Deploy a Trigger from sandbox to production, getting these 3 failed components upon validation of change set:

API NAME: ChatterAnswersEscalationTriggerTest.validateQuestionEscalation()
PROBLEM: Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []", Failure Stack Trace:


API NAME: MyProfilePageControllerTest.testSave()
PROBLEM: Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Number needs to be in (999) 999-9999 format.: [Phone]", Failure Stack Trace: "Class.MyProfilePageControllerTest.testSave: line 34, column 1"


API NAME: chatter_answers_question_escalation_to_case_trigger
PROBLEM: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required


Any suggestions/advice to get this change set to deploy would be EXTREMELY helpful.  Thanks in advance

Best Answer chosen by Andrew King
Vinit_KumarVinit_Kumar
Ok let me answer one by one 

1.)  For first error either you don't have the access to record/fields or it does not exist in destination org.

2.)  For 2nd one,there is custom validation in destination org which is not being honoured in class.MyProfilePageControllerTest.testSave: line 34, column 1.You must be inserting a record in which the Phone field is not in correct format.You need to update the same and then you are good to go.

3.) You don't have the test Class for the Trigger chatter_answers_question_escalation_to_case_trigger.Hence,there is no code coverage.

Hope this helps !!

If this helps,please mark it as best answer to help others :)