• Katie DeLuna 7
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 14
    Replies
I can't seem to update my trigger so that it only creates a ticket in Jira (webservice connector) when the case status equals "Escalated". Can someone help?

trigger SynchronizeWithJIRAIssue on Case (after insert) {
    system.debug('trigger!');
    //Identify profile name to be blocked from executing this trigger
    String JIRAAgentProfileName = 'JIRA Agent2';
    List<Profile> p = [SELECT Id FROM Profile WHERE Name=:JIRAAgentProfileName];

    //Check if specified Profile Name exist or not
    if(!p.isEmpty())
    {
        //Check if current user's profile is catergorized in the blocked profile
        if(UserInfo.getProfileId()!= String.valueOf(p[0].id))
        {
            for (Case c : Trigger.new) {
                    system.debug('inside case ' + c.CaseNumber);
                    //Define parameters to be used in calling Apex Class
                    String jiraURL = 'http://xxxxxxx';
                    String systemId = '2';
                    String objectType ='Case';
                    String objectId = c.id;
                    String projectKey = 'xxx';
                    String issueType = 'xx';
               
                    System.debug('\n\n status is escalated');
                    //Execute the trigger
                    JIRAConnectorWebserviceCallout.CreateIssue(jiraURL, systemId ,objectType,objectId,projectKey,issueType);
             }
        }
    }
}
I received this error when trying to save my trigger in the developer console

An unexpected error has occurred. 207196298-81555 (749494588) for deploymentId=1drn0000000DwsMAAS If this persists, please contact customer support.

Does anyone know what this error means? SF support would not help me with this and I'm not sure what the error means.
I'm trying to write a class and trigger that allows me to call out to a webservice - Jira. However, my url is getting a 'null' status. I realized there were spaces in the url, so I added %20 in the url. I still got the same message. I've included the debug log below:

req = System.HttpRequest[Endpoint=http://jira.zzz/rest/customware/connector/1.0/B6DB-9597-179C-LL4Y/Case/500n0000001OXcrAAG/LEV/Client%20Issue%20-%20Level%201/john%doe/test/issue/synchronize.json, Method=PUT]


08:55:20.064 (64488504)|SYSTEM_METHOD_EXIT|[32]|System.debug(ANY)
08:55:20.064 (64503763)|SYSTEM_METHOD_ENTRY|[34]|System.Http.send(ANY)
08:55:20.064 (64580655)|CALLOUT_REQUEST|[34]|System.HttpRequest[Endpoint=http://jira.zzz/rest/customware/connector/1.0/B6DB-9597-179C-LL4Y/Case/500n0000001OXcrAAG/LEV/Client%20Issue%20-%20Level%201/jiohn%doe/test/issue/synchronize.json, Method=PUT]
08:55:30.077 (10077030307)|EXCEPTION_THROWN|[34]|System.CalloutException: Read timed out
08:55:30.077 (10077113104)|SYSTEM_METHOD_EXIT|[34]|System.Http.send(ANY)
08:55:30.077 (10077198962)|SYSTEM_METHOD_ENTRY|[38]|System.HttpResponse.toString()
08:55:30.077 (10077291506)|SYSTEM_METHOD_EXIT|[38]|System.HttpResponse.toString()
08:55:30.077 (10077319303)|SYSTEM_METHOD_ENTRY|[38]|System.debug(ANY)
08:55:30.077 (10077335189)|USER_DEBUG|[38]|DEBUG|

exception caught = System.HttpResponse[Status=null, StatusCode=0]