Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

Due to complex setup and fields restriction in Salesforce, test class fails to deploy to environment. You may run into an error as follows:

Image RemovedImage Added

Environment

Cloud or DC

Diagnostics Steps

N/A

Cause

Complex fields such as Cascading fields or restricted fields in Salesforce may cause an issue as the JCFS testing trigger checks whether every logic is working as it has to or it could be positive or negative testing and is global (does not corellate to the fields mapping only). Test classes also confirms every trigger is executed at least once.

\uD83D\uDCD8 Instructions

To successfully deploy the Trigger, you would require to either:

  • Make the restricted field unrestricted for the duration of deployment

  • Give a value to the erroneous field while testing

Following is the test class that allows you to input the value into the fields in the erroneous field:

Code Block
@isTest public class CaseTriggerTest2 {
@isTest static void caseAfterUpdateTest() {
    //insert a new case manually, we also need to add other required fields in to the code
    Case c = new Case(
        Subject = 'ServiceRocket Test Case',
        Description = 'ServiceRocket Test Case',
        Parent__c = 'Parent A', //change to related field stated in the error message
        Child__c = 'Child 1' //change to related field stated in the error message
        
    );

    JCFS.JiraTriggerTestHelper.testAfterUpdate(c); 
}
}

Resolution

N/A

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@bc3e0baf
sortmodified
showSpacefalse
reversetrue
typepage
labelskb-how-to-article
cqllabel = "kb-how-to-article" and type = "page" and space = "SUPPORT"