Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated and reorganized

Image Removed

...

Image Added

Default Message Template

Code Block
languagejs
{
  "text":"

...

<eventType> in 

...

<spaceLink> by 

...

<userLink>",
  "attachments": [
    {
      "color": "#205081",
      "title": "

...

<contentTitle>",
      "title_link": "

...

<contentLink>",
      "text": "

...

<contentBody>"
    }
  ]
}

New format

Code Block
languagejs
{
  "text":"<eventType> in <spaceLink> by <userLink>",
  "attachments": [
    {
      "color": "#205081",
      "title": "<contentTitle>",
      "title_link": "<contentLink>",
      "text": "<contentBody>"
    }
  ]
}

...

${spaceLink}

<spaceLink>

...

Insert excerpt
Slack Advanced Message Formatting
Slack Advanced Message Formatting

Basic Template Keys

These are available on all actions:

KeyDataDescription

<spaceLink>

<Test Space Name|http://localhost:1990/confluence/display/TEST

...

>
A link to the space, formatted for inclusion in a Slack message.

<spaceKey>

...

TEST

...

A space key

...

${contentTitle}

<contentTitle>

  • This is a page

...

${contentLink}

<contentLink>

...

  • title (Page)
  • Re: This is a page title (Comment)
A page, blogpost title, task, question

<contentLink>

http://localhost:1990/confluence/display/TEST/This+is+

...

a+page

...

${contentBody}

<contentBody>

...

+titleA URL to the page, blog, task,

...

or question
<contentBody>This is

...

<contentBody; format="substring_2">

<contentBody; format="substring_2_4">

...

Use substring function to get string from index 2 to length

Use substring function to get string from index 2 to 4 (if string length <4 , it will get length)

...

<if(isNewPage>New Page <else> updated Page<endif>

<if(isNewBlogpost>New Blogpost <else> updated Blogpost<endif>

<if(isNewComment>New comment <else> updated comment<endif>

...

${userLink}

<userLink>

...

some example page content.An excerpt of page, blog, task, comment

<userLink>

<admin|http://localhost:1990/confluence/display/~admin

...

>A link to the user, formatted for a Slack message

<userName>

...

admin

...

A username

<eventType>

...

...

  • New page has created in Space

...

  • Updated page in Space
  • Commented in Space
Text describing the current action.
<event>EventType_CreatedPageAn event code

...

Advanced Template Object Attributes

AttributeActionsDescriptionExample Usage

isNewPage

isNewBlogpost

isNewComment

AllReturns a boolean that can be used with StringTemplate if statement expressions.
  • <if(isNewPage)>New Page<else>Updated Page<endif>
  • <if(isNewBlogpost)>New Blogpost<else>Updated blog post<endif>
  • <if(isNewComment)>New comment<else>Updated comment<endif>
page

Page Created
Page Updated

A page object<if(page.versionCommentAvailable)><page.versionComment><else>(no comment)<endif>
blogpost

Blog post Created
Blog post Updated

A blogpost object
spaceAllA space object
comment

Comment Created
Comment Updated

A comment object

<comment.container.title>

  • Gets the title of the page the comment is on (without the "Re:" present in contentTitle).
question

Questions Created
Questions Answered 

A question object
answer

Questions Created
Questions Answered

A answer object
task

Task Created
Task Completed

A task object