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
Lillian Co 9Lillian Co 9 

Salesforce - JIRA Cloud

Hi, attempting to create a trigger to create JIRA ticket when a checkbox is checked; Create_Infra_Ticket__c

trigger insertCase on Opportunity (after insert) {
    for (Opportunity opportunity : Trigger.new) {
        if(Create_Infra_Ticket__c == true){
    JCFS.API.createJiraIssue('JIRA PROJECT ID', 'JIRA ISSUE TYPE ID');
        }
    }


Really appreciate anyone that can help !
Khan AnasKhan Anas (Salesforce Developers) 
Hi Lillian,

I trust you are doing splendidly and enjoying the season!

You need to, respectively, hardcode the Jira project id and Jira issue type id. You can get this values from the Jira REST API.

Please refer to the below links which might help you.

https://docs.servicerocket.com/salesforce-jira/administrator-guide/automating-your-integration/configuring-automatic-jira-issue-creation-from-salesforce

https://confluence.atlassian.com/jirakb/how-to-get-project-id-from-the-jira-user-interface-827341414.html

https://confluence.atlassian.com/display/JIRA050/Finding+the+Id+for+Issue+Types

https://developer.atlassian.com/cloud/jira/platform/rest/


I hope it helps you.

Kindly let me inform if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas
Lillian Co 9Lillian Co 9
Thanks Khan. Unfortunately the error i'm getting is: 
Error: Compile Error: Variable does not exist: Create_Infra_Ticket__c at line 3 column 12

The field is on the opportunity
Khan AnasKhan Anas (Salesforce Developers) 
Hi Lillian,

Please modify if condition like below:
 
trigger insertCase on Opportunity (after insert) {
    for (Opportunity opportunity : Trigger.new) {
        if(opportunity.Create_Infra_Ticket__c == true){
    JCFS.API.createJiraIssue('JIRA PROJECT ID', 'JIRA ISSUE TYPE ID');
        }
    }
}

I hope it helps you.

Kindly mark this as solved if the information was helpful.

Thanks and regards,
Khan Anas
JonathanBJonathanB
trigger saleInsertedTrigger on i360__Sale__c (after update) {
    for (i360__Sale__c S: Trigger.new) {
        s.EE_Service_Level__c = 'full'

        || 

        s.EE_Service_Level__c = 'Audit Only';
    }
    JCFS.API.createJiraIssue('Project ID', 'Issue Type');
}
How do I add an || symbol?