src/modules/Jira/JiraDefaultToSlackConverter.php
/**
     * Converts $data into a formatted string message
     *
     * @param JiraWebhookData $data parsed data from JIRA
     *
     * @return string
     */
Converts $data into a formatted string message
@param JiraWebhookData $data parsed data from JIRA

@return string
Converts $data into a formatted string message @param JiraWebhookData $data parsed data from JIRA @return string
public function convert(JiraWebhookData $data)
    {
        $issue        = $data->getIssue();
        $assigneeName = $issue->getAssignee()->getName();
        $comment      = $issue->getIssueComments()->getLastComment();
        if (!$comment && !$assigneeName) {
            $message = vsprintf(
                "<%s|%s> %s: %s ➠ Unassigned",
                [
                    $issue->getUrl(),
                    $issue->getKey(),
                    $issue->getStatus(),
                    $issue->getSummary()
                ]
            );
        } elseif (!$assigneeName) {
            $message = vsprintf(
                "<%s|%s> %s: %s ➠ Unassigned\n@%s ➠ %s",
                [
                    $issue->getUrl(),
                    $issue->getKey(),
                    $issue->getStatus(),
                    $issue->getSummary(),
                    $comment->getAuthor()->getName(),
                    $comment->getBody()
                ]
            );
        } elseif (!$comment) {
            $message = vsprintf(
                "<%s|%s> %s: %s ➠ @%s",
                [
                    $issue->getUrl(),
                    $issue->getKey(),
                    $issue->getStatus(),
                    $issue->getSummary(),
                    $assigneeName
                ]
            );
        } else {
            $message = vsprintf(
                "<%s|%s> %s: %s ➠ @%s\n@%s ➠ %s",
                [
                    $issue->getUrl(),
                    $issue->getKey(),
                    $issue->getStatus(),
                    $issue->getSummary(),
                    $assigneeName,
                    $comment->getAuthor()->getName(),
                    $comment->getBody()
                ]
            );
        }
        return $message;
    }
public function convert ( JiraWebhookData $ data ) { $ issue = $ data -> getIssue ( ) ; $ assigneeName = $ issue -> getAssignee ( ) -> getName ( ) ; $ comment = $ issue -> getIssueComments ( ) -> getLastComment ( ) ; if ( ! $ comment && ! $ assigneeName ) { $ message = vsprintf ( " <%s|%s> %s: %s ➠ Unassigned", [ $ issue -> getUrl ( ) , $ issue -> getKey ( ) , $ issue -> getStatus ( ) , $ issue -> getSummary ( ) ] ) ; } elseif ( ! $ assigneeName ) { $ message = vsprintf ( " <%s|%s> %s: %s ➠ Unassigned\n @% s ➠ %s", [ $ issue -> getUrl ( ) , $ issue -> getKey ( ) , $ issue -> getStatus ( ) , $ issue -> getSummary ( ) , $ comment -> getAuthor ( ) -> getName ( ) , $ comment -> getBody ( ) ] ) ; } elseif ( ! $ comment ) { $ message = vsprintf ( " <%s|%s> %s: %s ➠ @%s", [ $ issue -> getUrl ( ) , $ issue -> getKey ( ) , $ issue -> getStatus ( ) , $ issue -> getSummary ( ) , $ assigneeName ] ) ; } else { $ message = vsprintf ( " <%s|%s> %s: %s ➠ @%s\n @% s ➠ %s", [ $ issue -> getUrl ( ) , $ issue -> getKey ( ) , $ issue -> getStatus ( ) , $ issue -> getSummary ( ) , $ assigneeName , $ comment -> getAuthor ( ) -> getName ( ) , $ comment -> getBody ( ) ] ) ; } return $ message ; }
Converts $data into a formatted string message
 @param JiraWebhookData $data parsed data from JIRA
Converts $data into a formatted string message @param JiraWebhookData $data parsed data from JIRA
/**
         * Issue doesn't have comments and is not assigned to a user
         */ /**
         * Issue is not assigned to a user
         */ /**
         * Issue doesn't have any comments
         */ /**
         * Default message
         */