DevGenius1 / Scripts

1 stars 1 forks source link

Slack #15

Open sani-d opened 5 months ago

sani-d commented 5 months ago

def issueKey = issue.key def jiraResult = get("/rest/api/2/issue/${issueKey}") .header('Content-Type', 'application/json') .asObject(Map)

if (jiraResult.status == 200){ def jiraFields = jiraResult.body.fields def webhookUrl = 'https://hooks.slack.com/services/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'

def msg = [
    text: "The following issue has been transitioned to Confirmed https://tideaccount.atlassian.net/browse/${issueKey}"
]

post(webhookUrl)
    .header('Content-Type', 'application/json')
    .body(msg)
    .asString()

} else { println "Failed to find issue: Status: ${jiraResult.status} ${jiraResult.body}" }

project = "FSB" and (updated < startOfDay(-2d) or (updated < startOfWeek() and updated < startOfDay(-4d))) AND status = "Code Review" and "Team Name[Select List (multiple choices)]" = FS-Perlite