Skip to content

Commit

Permalink
Print the job's groupname if present
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
fibbers committed Aug 17, 2015
1 parent bdab5f9 commit a7b1a1a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/resources/templates/slack-incoming-message.ftl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<#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}">
</#if>
<#assign message="<${executionData.href}|Execution #${executionData.id}> of job <${executionData.job.href}|${jobName}>">
<#if trigger == "start">
<#assign state="Started">
<#elseif trigger == "failure">
<#assign state="Failed">
<#else>
<#assign state="Succeeded">
</#if>

{
"attachments":[
{
Expand All @@ -15,7 +21,7 @@
"fields":[
{
"title":"Job Name",
"value":"<${executionData.job.href}|${executionData.job.name}>",
"value":"<${executionData.job.href}|${jobName}>",
"short":true
},
{
Expand Down

0 comments on commit a7b1a1a

Please sign in to comment.