How to Post Custom Jira query results in Slack which are NOT based on status change

Priyanka Chandola
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2018

Is there a way to send   JQL query results to a slack channel where the results are not based on status change.In short I want to run a query in Jira each week based on date/custom field and push the results (multiple rows)  to a Slack channel or dm the assignee of the JIRA in slack .

Since the query is not based on status change in JIra , Standard integration is not what I am looking for.

Can I accomplish this from a script or a app.Looking for pointers or any information to get started.I have already created a webhook.

3 answers

0 votes
Maria Makarova
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 18, 2023

Hey @Priyanka Chandola 

I came across your question about sending JQL query results to a Slack channel, and it sounds like you're looking for a solution beyond the standard integrations, especially since your query isn't based on status changes in Jira. I found a template that could be helpful for you.

There's this app called "Slack Mention Jira Query Generator" that's designed to help you generate JQL queries directly from Slack - https://www.getlazy.ai/templates/jira-jql-generator-slack-bot-153a223f-7497-43a6-9d62-6e9d150e039e. It's pretty slick – you just mention the app in a Slack message, and it creates a JQL based on your message. If you want to run the query, it does that on Jira and returns the results right in the same Slack thread.

To get started, you'd need to set up a few environment secrets for Slack and Jira, like SLACK_BOT_TOKEN, SLACK_APP_TOKEN, JIRA_API_TOKEN, JIRA_EMAIL, and JIRA_SERVER_URL. It's all laid out in a step-by-step guide on the Lazy platform. The template includes a Test button to make deployment easy.

Once everything's set up, interacting with the Slack bot is simple. Just mention the bot in a message to generate a JQL query. The bot will respond in the thread, asking if you want to run the generated query. If you say yes, it executes the query on Jira and posts the results in the Slack thread.

0 votes
James_McManamey July 31, 2019

James from stratejos here :) Thanks @Er for giving stratejos a try. 

stratejos does indeed let you run JQL directly from Slack. You can read more about how the feature works in this post.

Based on the OP's comment, what I would suggest checking out our custom messages. These messages let you get the results of any JQL posted to Slack on a recurring schedule. You control how the message looks and exactly what gets included.

We have teams using custom messages to do all sorts of cool stuff including: 

Daily overdue issues - Posting all issues overdue and due today to a team channel each morning 

Weekly stats - Posting counts of opened and resolved Bugs, tasks and stories to a shared channel 

Daily new blockers - Direct messaging a team lead each day with a list of issues that were marked as blocked. 

You can read more and start a free trial here -> https://stratejos.ai/scheduled-messages

0 votes
Josh Steckler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2018

You may want to look at http://nextup.ai

sniederb August 30, 2018

I've written a tool which can do exactly that, download at http://isthmus.want.ch. It connects REST APIs, there's a "recipe" to run a JQL and report the results to Slack.

Like william hardcastle likes this
Er June 24, 2019

@sniederb 
I get it that one needs admin access to be able to use webhooks on the Jira server, so as to be able to use that tool?

sniederb June 24, 2019

@Er , the REST API is enabled by default in JIRA (starting with version 7). The API itself uses basic authentication, so any user registered in JIRA can be used to access the API. The actions will then be limited to the authorizations granted to that user, and things like history, comments etc. are listed as in that user's name.

If you want JIRA events to trigger an HTTP event, then yes, you'd need an admin to set up the webhook. The OP asked how to run a query in Jira each week, this is easily done with http://isthmus.want.ch using a CRON/timed rule running a JQL and reporting the result to Slack (I actually have that exact setup running on my own project). For that setup no webhooks are required.

Er June 24, 2019

Oh Thanks for the clarification Simon!.  

I will try, then , to delve into the REST API so as to see how to write JQL queries in the body of a message in Slack, to get the ticket list filtered by the query.


Er June 24, 2019

fyi, I am trying Stratejos for Slack and it seems to have what I look for!

Like James_McManamey likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events