From a7b1a1aafba3227affb1c1c8490d8e4cc723fcb4 Mon Sep 17 00:00:00 2001 From: Willem Fibbe Date: Mon, 17 Aug 2015 14:30:57 +0200 Subject: [PATCH] Print the job's groupname if present We have several groups containing jobs with equal names, e.g. group1: - update - restart group2: - update - restart In Slack we can now differentiate between the jobs: "Execution #246 of group1/update" instead of just: "Execution #246 of update" --- .../resources/templates/slack-incoming-message.ftl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/slack-incoming-message.ftl b/src/main/resources/templates/slack-incoming-message.ftl index 286ec3c..413d034 100644 --- a/src/main/resources/templates/slack-incoming-message.ftl +++ b/src/main/resources/templates/slack-incoming-message.ftl @@ -1,4 +1,9 @@ -<#assign message="<${executionData.href}|Execution #${executionData.id}> of job <${executionData.job.href}|${executionData.job.name}>"> +<#if executionData.job.group??> + <#assign jobName="${executionData.job.group} / ${executionData.job.name}"> +<#else> + <#assign jobName="${executionData.job.name}"> + +<#assign message="<${executionData.href}|Execution #${executionData.id}> of job <${executionData.job.href}|${jobName}>"> <#if trigger == "start"> <#assign state="Started"> <#elseif trigger == "failure"> @@ -6,6 +11,7 @@ <#else> <#assign state="Succeeded"> + { "attachments":[ { @@ -15,7 +21,7 @@ "fields":[ { "title":"Job Name", - "value":"<${executionData.job.href}|${executionData.job.name}>", + "value":"<${executionData.job.href}|${jobName}>", "short":true }, {