Now you can automatically track your time in Slack. While we do not offer an official Slack Integration yet, you can quickly and easily build your own for your organisation using Zapier. You can use Zapier to create an automation that is triggered by a Slack event and then sends a request to EasyTime's Tracking API.

Before you get started: 

  • You will need a Zapier account. Zapier is free to get started, but monthly usage is capped at a 100 task. See more information about Zapier's pricing here. 
  • You will need to have permission to add apps to your Slack workspace. 
  • You will need the EasyTime App installed on your Jira.

Create your 'Zap' 

From the Zaps menu click the 'Create' button and select 'New Zap.'

Create your 'Trigger'

  1. Select 'Trigger.' 


  2. Select 'Slack' from the menu.


  3. Select 'New Public Message Anywhere' from the 'Event' dropdown menu in the Trigger options.


  4. If you haven't connected Slack to Zapier yet, click 'Sign In' under the 'Account' section and follow the on-screen instructions to connect Zapier to your Slack workspace. 


  5. Follow the prompts to test your Trigger. 

Create your 'Action'

  1. Select 'Action.' 


  2. Select 'Code by Zapier' from the menu.


  3. Select 'Run JavaScript' from the 'Event' dropdown menu in the Action options.


  4. Follow the prompt and create two 'Input Data' fields from the 'Channel Name', 'User Real Name', and 'Text' fields given by Slack as shown below. You should see some sample data from your test trigger.


  5. Copy and paste the following code into the 'Code' section of your 'Action' options.

    let tokenMap = {
      "name" : "token1234567"
    };
    
    // find the the user in the map
    let token = tokenMap[inputData.name];
    // continue if key is found
    if (token) {
      // parse issue key
      let ar = inputData.message.toUpperCase().match(/[A-Za-z]+-\d+/g) || inputData.channel.toUpperCase().match(/[A-Za-z]+-\d+/g);
      let issueKey = [ar[0]];
      // set up data for body of request 
      let data = {
        issueKeys: [`${issueKey}`],
        type: "COMMENT",
        integrationKey:"org.techtime.slack.plugins.easytime"
      }
      // send post request to tracking API 
      fetch("{YOUR JIRA BASE URL OR https://cloud.techtime.nz/cloud/easytime}/rest/easytime/2.0/track?action=track", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Accepts": "application/json",
          "Authorization": `Bearer ${token}` 
        },
        body: JSON.stringify(data),
      }).then(res => res.text()).then(result => {
        callback(null, {data, result})
      }).catch(e => { callback(e, {data})});
    } else {
      callback(null, {inputData});
    }
    
    



  6.  If you are on Jira Cloud please use https://cloud.techtime.nz/cloud/easytime as the base URL of the API request in the code block. Use your Jira base URL if you are using Jira Server of Data Center.

Adding Tokens 

In order to get this integration to work you will need to add tokens to your integration. Generate your tokens using these instructions.

Each of your team members who wish to use EasyTime with Slack will have to generate their own token which you will need to add to this list. 

Once you have a token you can add it to the tokenMap object at the top of your code. Use the full name as the key, and the token as the value. 

let tokenMap = {
  "name" : "token1234567"
	......
	......
};

Test Your Zap

Once you have published your Zap you can test it by sending a message with a valid Jira Issue Key in a public channel in your Slack workplace.



You should see time logged in 'My Day' in Jira if everything is working correctly. 

Zapier code actions are limited to running for 1 second with a free tier account. This may cause Zapier to show errors because the API may take more than 1 second to respond. However, this does not stop time from being logged since the request is already sent. 

Please do not hesitate to reach out to our 24x7 support team if you have any questions about using EasyTime with Slack.  

Got Feedback?

We are looking for feedback from both profit-focused (consulting) and cost-centre (IT, support) type of teams.  

Any feedback perspective - sales, marketing, procurement, management, user, just personal feedback on the idea itself - will be greatly appreciated.

More information

Find EasyTime on Atlassian Marketplaceinstall via UPM, do the minimal configuration as per our Getting Started with EasyTime guide, review our Glossary, our FAQ  and the full list of EasyTime Features. Enjoy consistent and accurate timesheets in real-time.

If you have any configuration questions or ideas for improvements, you can always contact us.

Contact us




EasyTime Articles

Try for free

EasyTime for Jira Software, Jira Service Desk, Jira Core

Try for free