Send direct message on Slack

maciej.wicher December 27, 2019

Hi!

I've got Jira board for service desk team (10 members) where users around the organisation can creates a sort of tickets (repo access, add specific tool to the project etc.). Once a day I want to send private message to every service desk team member with tickets assigned to them.

Is it possible to send a direct message, once a day, on Slack to user with list of assigned tasks from Jira? I know there is a Automation for Jira tool but I don't know how to send message only to assigned user - is it possible without writing a bot from scratch?

 

Cheers,

Maciej

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2020
Hi Maciej,
 
Great question! I haven't seen Automation for Jira utilized in this way before, but it is definitely possible. Here's an overview of a rule that can make this happen, before we get into the nitty gritty on setting it up:
 
1.png

Alright, let's build it!
 
  1. Create a new Project automation rule in the project your agents are working out of (you can access the Project automation section from the Project Settings)

  2. Use the Scheduled trigger for the rule
    2.png

  3. Set the rule to use a cron expression and select the option for "simply run the conditions and actions without providing issues". Example:
    3.png

  4. Set the details for the cron expression. If you’re unfamiliar with cron, you can see how the statements are constructed in our documentation. You can also use a tool like Crontab Guru to get the details right, but note that Automation for Jira (and Jira in general) has a seconds argument, so you will run into an error if you just copy/paste from Crontab Guru without putting an extra 0 at the beginning of your expression. The timestamp is in UTC as well, so you'll need to consider the timezone of your team.
    For teams in the US Eastern timezone, this expression will run every weekday morning at 7:00am:
    0 0 12 ? * MON-FRI
    Whereas teams in Europe may want something like this:
    0 0 6 ? * MON-FRI
    Click the blue Save button when the cron expression is ready.

  5. You should now be on the page to add a component. Select the Branch rule component from the options here.
    4.png

  6. Under the “Type of related issues” dropdown, select the JQL option.
    While writing the JQL, you’ll want to use the closed statuses for your project’s workflow, and use the “Insert account id” tool to choose one of the users you want to send issues to. The JQL you wind up with might be something like 
    status not in (Done) and assignee = 555resolved-atlassian-account-id555
    5.png
    Click the blue Save button when the JQL is filled in.

  7. Now choose the “New action” option on the add component screen. This should insert the action under the “For JQL” branch you just configured in the rule. Choose the Send Slack message option from the available actions.
    6.png

  8. Add details here to send the Slack message. Here are some pointers -

    Webhook URL: use the “configure an incoming webhook” link below the field to generate a URL from your Slack admin panel
    Message: Copy and paste this message for a short and clean message:
    <{{issue.toUrl}}|*{{issue.key}}*  {{issue.summary}}>

    {{issue.description}}
    Channel or user: If you don’t put anything here, it will use the channel you configured the webhook for. I would recommend using the userID of the Slack user that matches the assignee you set up in step 6. Click here for a pointer if you need help finding a Slack user’s IDProtip: you can keep using the same webhook URL even if you use different userIDs
    7.png
    Click the blue Save button when you’ve got this step finished.

  9. Repeat steps 5 to 8 for each user you want to send the morning list to.

  10. Once you're satisfied, give the rule a name and hit that blue "Turn it on" button.
    save.png
You’re all set! The users you’ve configured will now get a list of unclosed issues assigned to them in Slack each morning. They can click the issue key / summary to be taken to the issue in Jira.
8.png

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events