Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

First time creating a JQL query for Slack Channel Notification

Jessica Franco September 1, 2023

Hi! I'm trying to create my first JQL query to allow a notification to be posted to a slack channel. One already existed for this channel, so I needed to update the existing one to include a separate notification (because I don't think there's a way to create a separate notification to the same channel).

I would like to have a notification for when any issues are created with the issue types task, story, or bug. As well as a notification when an issue with the label "onboarding" status changes to "done".

 

(issue = 'created' AND (issuetype = task OR issuetype = story OR issuetype = bug))

OR

(labels = 'onboarding' AND status changed to 'done')

 

When I try to save this query, I keep getting the following error, but I'm unsure of what I'm doing wrong: 

Invalid JQL

Could not save project connection settings

 

Thank you!

2 answers

2 votes
Mikael Sandberg
Community Champion
September 1, 2023

Hi @Jessica Franco,

Welcome to Atlassian Community!

You are getting the error because JQL doesn't recognize  issue = created. The create event is not something that you filter on in an JQL.

And yes, you can have multiple notifications going to the same channel. Here is what I would do. Keep the original automation, which I assume is triggering on Issue create and then create a new one that is triggered on the transition to Done, something like this:

Screenshot 2023-09-01 at 2.03.33 PM.png  

0 votes
Jessica Franco September 1, 2023

Hi @Mikael Sandberg ! Thank you so much for your response. And I apologize if this is a simple question, I'm learning as I go! but I do not have the same view you do. I am looking at this one: 

Screenshot 2023-09-01 at 5.26.24 PM.png

How can I find your view?

 

Also is it easier to just update the JQL instead?

Thank you!

Mikael Sandberg
Community Champion
September 1, 2023

Ah, I forgot about the Slack integration. From there you can only have one connection to each channel.

My view is from Automation, you get to it if you go to Project settings > Automation and from here you can create rules. And automation do not have the same limitation as the Slack integration, but you would need to create an app in Slack that accepts incoming webhook. But that is really simple and Slack's documentation has an example for it.

If you want to keep using the Slack integration then the integration should look like this:

Screenshot 2023-09-01 at 2.48.46 PM.png

Note that you would have to trigger on the status transition, you cannot use the Issue is option since you are covering two different events.

I prefer using the automation because you can then control what is being included in the message sent to Slack and you are not limited to a single integration.

Like Vikrant Yadav likes this
Jessica Franco September 6, 2023

Hi @Mikael Sandberg , after a few days of making sure all is working correctly, this is complete, thank you!!

 

Note: I did have to remove the quotes around the Onboarding label, but other than that, it worked!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events