Skip to main content
Pam Vandekerkhove (xx) 님이 #Apex에 질문했습니다
Hi - I am trying to create a custom Save button for the CASE object.  I would like standard save functionality along with this code so that the case will synchronize with JIRA.  Could I please have help with the code?

https://jira-dev.int.helloworld.com/plugins/servlet/customware/connector/issue/7/Case/synchronize.action?id={!Case.Id}

 
답변 2개
  1. 2017년 2월 15일 오후 4:33
    1. Create  Hierarchy type custom setting and assing value if the field with this URL.

    2. Also assign API key for JIRA in another field, this would be easy for future use

    3. write webservice class and embed it in custom buttin on the object 

    To make things easier, we now need to create a button such that whenever it is clicked, the case should be created in JIRA. In developer language, what that means is an apex class is called when the button is clicked. Since we are relying on an external API, we write a web service class to call an apex class and perform the action in Salesforce. In this case, the web service class is written to call the JIRA service.

    - create button in Case

    - Upon clicking it, the below screen is what you get. As you can see, there is JSON Declaration that calls the web service apex class.

    {!REQUIRESCRIPT( "/soap/ajax/35.0/connection.js" )}

    {!REQUIRESCRIPT( "/soap/ajax/35.0/apex.js" )}

    var cs = new sforce.SObject("Case");

    cs.Name = '{!Case.Name}'

    result = sforce.connection.create('cs');

    if (result[0].success == true){

    var obj = { "caseId" :"{!cs.Id}", "CaseDesc" :"{!cs.Description}", };

      sforce.apex.execute( "callJIRA", "crateCaseMethod", obj );

      location.reload();

    }

    c. place this button in case page layout
0/9000