You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I use a script to send mattermost notifications if new tasks are created. He works. But if the title/name of the task has this " " sign, the notification does not come..
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient import com.atlassian.jira.component.ComponentAccesso
def hookURL = "https://****/hooks/***"
def activitiRestClient = new RESTClient(hookURL)
def creator = issue.getCreator()
def creatorUsername = creator.getUsername()
def creatorName = creator.getDisplayName()
def issueKey = issue.getKey()
def issueSummary = issue.getSummary()
def priority = issue.getPriority().name
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cFieldTeam = customFieldManager.getCustomFieldObjectByName("command")
def team = issue.getCustomFieldValue(cFieldTeam).toString()
def cFieldSeverity = customFieldManager.getCustomFieldObjectByName("Severity")
def severity = issue.getCustomFieldValue(cFieldSeverity).toString()
def cFieldWhereBugFound = customFieldManager.getCustomFieldObjectByName("where is the error")
def whereBugFound = issue.getCustomFieldValue(cFieldWhereBugFound).toString()
def teamMentionMap = [
"Bw2": "@bug_%s_b2c",
"wer": "@bug_%s_omni",
"vf": "@bug_%s_kpp",
"wed": "@bug_%s_oes",
"erf": "@bug_%s_core",
"edvf": "@bug_%s_wlk",
"not specified": "command not specified but %s!"
]
def scopeMap = [
"prod": "prod",
"test": "test"
]
def teamMention = String.format(teamMentionMap.get(team), scopeMap.get(whereBugFound));
def body = "{\"username\":\"New Bug\","
body += "\"icon_emoji\":\":ladybug:\","
body += "\"attachments\":[{\"color\":\"#FA5537\","
body += "\"text\": \"${issueSummary}\","
body += "\"title\": \"${issueKey}\","
body += "\"title_link\": \"https://***/jira/browse/${issueKey}\"}],"
body += "\"text\":\"${teamMention} new issue **${creatorName}** (@${creatorUsername})\n"
body += "Priority: **${priority}**, Severity: **${severity}**, where is the error?: **${whereBugFound}**\"}"
activitiRestClient.post(
contentType: "text/plain",
requestContentType: "application/json",
body: body,
)