Hi, their!
I am newbie in Automatisation Jira
I have a issue, I need to create a request for a JQL query for automation in Jira
If there are tasks for approval, then send a message in Slack with a summary of tasks, if there are no tasks for approval, send a message “no tasks”
but when using the if function, I receive a message for each task, I think that the issue is in the request itself, how can I make the request correctly?
Hi @George Davitaya and welcome to the Community!
{{lookupissues}} as you are using it is a smart value, it is not a JQL filter. In the use case, as you describe it, you should not add a JQL filter to your rule trigger, but instead run a Lookup Issues action first, with the appropriate filter to retrieve the issues you need. That may be something like this
status = "Waiting for Approval"
After that, you can use the {{lookupIssues}} smart value to refer to those issues and use it in conditions and further actions. The overall framework of your automation rule would then look like this:
I used {{lookupIssues.size}} to count the number of issues returned by the filter. If there are 0, you can send a message that there is nothing to see here (or do nothing at all), and use the else part to send the desired message.
I used the log action because I don't have a Slack integration in my test instance, but I suppose you can see where your Slack messages should be ...
Hope this helps!
Hello! @Walter Buggenhout
Unfortunately this still doesn't work for me(
Are you sure that status = "Waiting for Approval" is the right request? I still receive a message for every task in Slack
And if there is no task in the status "Waiting for Approval", I don't receive notifications(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @George Davitaya,
No, of course I am not sure if that is the correct JQL 😅 - I am not familiar with how your Jira configuration has been set up. It should be whatever it needs to be to pull a list of issues that need approval according to how that has been set up for you.
Since I notice that you tagged JSM in your question, it is possible that the below might work:
approval = pending()
That is the way you can search for the issues marked for approval following JSM's default behaviour.
But before applying it to your rule, go to the issue navigator in Jira first (via Filters > View all issues) and try out the provided query option first to make sure they return the right results. Then apply the correct JQL to your automation rule.
And again: uncheck the box "run a JQL search ..." from your rule trigger and replace it with the lookup issues action in my screenshot. As it literally says in the screenshot, your current setup "executes the action for every issue in the query"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.