Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Problem with sending notifications

Edited

 

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,
)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events