You need to sign in to do that
Don't have an account?

How to write a trigger on Case Object whenever a case is identified in case object and it should create a issue in JIra..??
I am having a issue in Trigger. Its unable to fire..
trigger CreateWithJIRAIssue on Case (after insert) {
List<Case> escCases = new List<Case>();
for (Case c : Trigger.new){
// all the cases that have status as abc' is added to a list called xCases
if(c.Status == 'abc'){
xCases.add(c);
}
}
if(xCases != null && xCases.size()>0){
// now iterate over the selected cases and call the web service
for(Case c : xCases){
//call webservice
system.debug('inside case ' + c.CaseNumber);
//Define parameters to be used in calling Apex Class
String jiraURL = 'http://jira';
String systemId = '2';
String objectType ='Case';
String objectId = c.id;
String projectKey = 'LEV';
String issueType = 'BUG';
System.debug('\n\n status is escalated');
//Execute the web service call
JIRAConnectorWebserviceCallout.CreateIssue(jiraURL, systemId ,objectType,objectId,projectKey,issueType);
}
}
}
}
}
trigger CreateWithJIRAIssue on Case (after insert) {
List<Case> escCases = new List<Case>();
for (Case c : Trigger.new){
// all the cases that have status as abc' is added to a list called xCases
if(c.Status == 'abc'){
xCases.add(c);
}
}
if(xCases != null && xCases.size()>0){
// now iterate over the selected cases and call the web service
for(Case c : xCases){
//call webservice
system.debug('inside case ' + c.CaseNumber);
//Define parameters to be used in calling Apex Class
String jiraURL = 'http://jira';
String systemId = '2';
String objectType ='Case';
String objectId = c.id;
String projectKey = 'LEV';
String issueType = 'BUG';
System.debug('\n\n status is escalated');
//Execute the web service call
JIRAConnectorWebserviceCallout.CreateIssue(jiraURL, systemId ,objectType,objectId,projectKey,issueType);
}
}
}
}
}
Please Mark as Best answer if it resolves your query.
All Answers
Is your webservice class method is annotated with future annotation.(@future).
If no then add that and if no what is the error you are getting ?
Please Mark as Best answer if it resolves your query.
Can you please send me the code of the JIRAConnectorWebserviceCallout. We have a requirement that the jira issue should be createad automatically from the salesforce.
Appreciate your help.