This plugin creates the 'Notify Slack' post function that allows you to send a pre-formatted message at various steps in the workflow, which is fantastic!
The 'Message' field allows you to use variables such as $issue.status.name which will be substituted with the issue's status. If you click the 'Example' button, you can see that it's a Velocity template.
Where is the documentation for this? How sophisticated is this functionality? Can I use custom fields? I haven't been able to so far. I made some guesses and $issue.MyFieldName and $issue.customfield_12345 are just interpreted literally. I have even tried stuff like
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_12345"))
$issue.getCustomFieldValue($customfield)
but I get this in Slack
Error in Notify Slack configuration for project https://myjira.com/projects/MYPROJ Please contact your administrator to make sure that Notify Slack post-function comes after the issue creation.
(EDIT: I should note here that the post function does indeed come after issue creation, so the error message is not relevant)
Can anyone shed some light on this great new feature? Maybe my Velocity skills just aren't up to snuff? Or point me at wherever Atlassian has hidden the docs (the 'normal channels' take me here https://confluence.atlassian.com/slack/using-jira-applications-with-slack-966662163.html which is not helpful)
Much thanks,
Hi Sean
The variables that we should be able to use in the "Notify Slack" post-function are the following ones:
context.put("user", event.getActor());
context.put("issue", event.getIssue());
context.put("project", event.getIssue().getProjectObject());
context.put("status", event.getIssue().getStatus());
context.put("priority", event.getIssue().getPriority());
context.put("issueType", event.getIssue().getIssueType());
context.put("creator", event.getIssue().getCreator());
context.put("assignee", event.getIssue().getAssignee());
context.put("reporter", event.getIssue().getReporter());
context.put("action", event.getActionName());
context.put("firstStep", event.getFirstStepName());
context.put("endStep", event.getEndStepName());
The integration does not grant access to internal Jira objects as that could be dangerous.
There is an improvement request opened to customize which fields could be displayed in the JIRA to Slack notification (refer API-95).
We hope the information above helps!
Cheers!
L.F
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.