When issue rank changes, notify slack channel
Asked by Mauricio Heberle:

Hey everyone! I've got the following scenario:  

My team wants a notification to be sent everytime they update an issue rank.

Heres is my current setup

![Captura de Tela 2023-04-03 a?s 16.31.30.png](https://community.atlassian.com/t5/image/serverpage/image-id/249568iDF4EE5727D86A384/image-dimensions/280x472?v=v2 "Captura de Tela 2023-04-03 a?s 16.31.30.png")  

It works, but as you can see, in order to create a list of the issues that I want to send via Slack, I must add the loopkup with a JQL.

The problem is, the Rank field is really tricky to work with in Jira and theres no viable JQL to write it, so I put the "updated \>= - 60m" to filter recent altered ranked issues. Obviously, it is causing that anytime an issue is updated (like any custom field), it triggers the automation.

I thought about using smart values, and thats where someone might have a solution which I havent found. Heres what I tried:

{{issue.latest.changelog}} -- Because I want a way to condition the latest change log, but it gives a strange result -\> ChangeLogList{startAt=0, maxResults=0, total=0, histories=null}

{{issue.changelog.Rank}} -- It shows the the log correctly, but without a way to filter it as the most recent, it wont properly work either --\> ChangeItemBean{fieldId='customfield_10400', field='Rank', fieldType='null', from='', fromString='', to='', toString='Ranked higher'}

I know its a long explanation, but thats it. Any tips are welcome! Thanks in advance.


Answers:
author: Bill Sheboy
body: Hi [@Mauricio Heberle](/t5/user/viewprofilepage/user-id/4973359)

Your rule is triggered on any update, and then checks for a change to Rank before proceeding. That will trigger for each issue meeting that criteria.

And so, what is the purpose of your lookup issues action? If you remove that and just use the {{triggerIssue}} information, that would do what you describe.

Or instead, are you looking for some type of rollup of "issues re-ranked in the last X-time units"?

Kind regards,  
Bill

comments: author: Mauricio Heberle
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) !

*"Or instead, are you looking for some type of rollup of "issues re-ranked in the last X-time units"?"*

Yes, whenever people reorder issue ranks of a project within a timeframe, I want to send the list of the issues that were rearranged, based on their rank. Does that make sense? The only way I know how to create a list, is using the lookup. Problem is how to create a proper jql to combine altered ranks and timeframe

I dont understand how the triggerissue would help me in this case, but thanks in advance.


author: Bill Sheboy
body: Thanks for clarifying. If you wanted to notification with each single change, that is where {{triggerIssue}} would help.

But you seem to want a list of re-ranked items, such as for the last hour...I can think of two ways to do that:

1. Walk all of the open issues and check the change log for Rank changes, and then report on those. That may not be easy to rollup the information.
2. Use two rules, where one detects a Rank change (as you have done) and then save that date/time in a custom field. You could then use a second, scheduled trigger rule to query that custom field with JQL in a lookup issues action to send the notification.

Honestly and IMHO, this seems a bit much to get alerts on Rank changes in a tool outside of Jira (i.e., Slack). It makes me wonder about the team practices as this might be disruptive getting push-notifications as a product owner is just doing their daily work of ordering a backlog.


author: Mauricio Heberle
body: I searched a lot about point 1., but it just seems impossible due to JQL syntax and how Jira treats the Rank field.

I guess the best option is to talk to my team and change how we will approach theses alerts.

Thanks, Bill!


Tags: log

notification

rank

slack