Auto Push Case Comments to JIRA

Aug 29, 2016 | Uncategorized

While Case Comments may be sent to related Issue(s) in JIRA at any time using #JIRA hashtag, you can also optionally auto push Salesforce Case comments to related Issue(s), as shown below.

In order to send Case Comments Automatically, you will need a custom trigger on Case Comment before insert. This trigger will check if the Parent Case of the Case Comment has at least one related JIRA issue and does not include hashtag JIRA in the comment body.

Please note that while we offer this as a guide, customizations based on zAgileConnect objects and resources are not supported by zAgile unless performed directly by zAgile.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
trigger CCommentTrigger on CaseComment (before insert) {
    Set<Id>caseIds = new Set<Id>();
    for(CaseComment cc:trigger.new){
        caseIds.add(cc.ParentId);
    }
    Map<Id,Case>mapCases = new Map<Id,Case>(
        [SELECT Id,(SELECT Id FROM zsfjira__ZIssue_SF__r) FROM Case WHERE Id IN :caseIds]);
    
    for(CaseComment cc:trigger.new){
        Case current = mapCases.get(cc.ParentId);
        if(current.zsfjira__ZIssue_SF__r.size()>0 && !cc.CommentBody.toLowerCase().contains('#jira')){
            cc.CommentBody = '#JIRA '+cc.CommentBody;
        }
    }
}
 
Tags:

> You Might Also Like

How to Notify Salesforce Case Owner on Jira Issue Transitions

How to Notify Salesforce Case Owner on Jira Issue Transitions

The steps below describe the integration of Jira Issue updates to Salesforce via zAgileConnect with Salesforce Flow and Process Builder. The objective in this example is to notify Salesforce Case owner via email based on certain Issue Updates posted to Salesforce from...

JIRA Integration User Required Permissions

JIRA Integration User Required Permissions

In this page, we will describe all of the required  JIRA Integration User permissions. JIRA Integration is not required to have Administrator privileges. Salesforce users interact with a subset of JIRA Projects, for all these Projects the JIRA Integration user...

Loading...