...
Default Message Template
Code Block | ||
---|---|---|
| ||
{
"text":" |
...
<eventType> in |
...
<spaceLink> by |
...
<userLink>", "attachments": [ { "color": "#205081", "title": " |
...
<contentTitle>", "title_link": " |
...
<contentLink>", "text": " |
...
<contentBody>" } ] } |
New format
Code Block | ||
---|---|---|
| ||
{
"text":"<eventType> in <spaceLink> by <userLink>",
"attachments": [
{
"color": "#205081",
"title": "<contentTitle>",
"title_link": "<contentLink>",
"text": "<contentBody>"
}
]
} |
...
${spaceLink}
<spaceLink>
...
Insert excerpt | ||||
---|---|---|---|---|
|
Basic Template Keys
These are available on all actions:
Key | Data | Description |
---|---|---|
<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> |
|
...
${contentLink}
<contentLink>
...
| A page, blogpost title, task, question |
<contentLink> | http://localhost:1990/confluence/display/TEST/This+is+ |
...
a+page |
...
${contentBody}
<contentBody>
...
+title | A 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> |
...
...
|
...
| Text describing the current action. | |
<event> | EventType_CreatedPage | An event code |
...
Advanced Template Object Attributes
Attribute | Actions | Description | Example Usage |
---|---|---|---|
isNewPage isNewBlogpost isNewComment | All | Returns a boolean that can be used with StringTemplate if statement expressions. |
|
page | Page Created | A page object | <if(page.versionCommentAvailable)><page.versionComment><else>(no comment)<endif> |
blogpost | Blog post Created | A blogpost object | |
space | All | A space object | |
comment | Comment Created | A comment object |
|
question | Questions Created | A question object | |
answer | Questions Created | A answer object | |
task | Task Created | A task object |