Forums

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

Trigger action when most recent work item edit was a ranking change

Michael Ball-Marian
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!
July 11, 2025

I am trying to trigger some actions (email or Slack msg) when someone updates the rank of a certain set of work items. 

The condition I am currently using is:

Trigger: When work item updated

Condition: {{changelog.Rank}} does not equal Empty

I have other conditions as well to narrow the list, but the one I am having trouble with is detecting if the most recent edit contained a rank change. 

My above does not work, because it triggers if there has EVER been a change to rank (that smart value returns a list of changes to Rank for the history of the issue). 

What I need to do is find out if the most RECENT edit to the issue was a rank change. 

Note related discussions here. This person was on a similar track, but ultimately was hung up on another issue. 

 

Is there a way to query the Changelog for the most recent edit changes only?

3 answers

1 accepted

1 vote
Answer accepted
Michael Ball-Marian
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!
July 15, 2025

After sleeping on it and re-thinking it, I simply changed my query approach and got it to work. 

In the long thread with Bill, I keep trying to check this condition:

If {{changelog.rank}} does not equal empty

That should work, but perhaps something was misformed. Not sure. It would trigger on ANY edit, not just re-ranking edits. 

Then I shifted my strategy to check this condition:

If {{changelog.rank.toString}} contains Rank

This condition works properly! If there is a rank change, it fires and I get the notice. If any other edit, it does not fire. Solved!

1 vote
Bill Sheboy
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.
July 11, 2025

Hi @Michael Ball-Marian -- Welcome to the Atlassian Community!

First, what problem are you trying to solve?  That is, "why do this?"  Knowing that may help the community to offer additional suggestions.

 

Next, what version of Jira are you using: Cloud, Server, or Data Center?

I ask that question because with Jira Cloud, the {{changelog}} smart value provided to rules for a field update or generic work item updated trigger only contains information about the changes which triggered the rule, and not a complete list of all changes over time.

With those trigger types, when you need to know the last change to the Rank value, you could try using that smart value, stored in a Created Variable, and then looking for the field's name in the text.  To guarantee one only has the latest change for that specific field, they would need to read the changelog entries using the REST API endpoint with the Send Web Request action.

However...

 

Many things can change the Rank for a work item, including just drag-and-drop to change Status on a board.  Thus the result could be quite "noisy" messaging.

And the Rank field contains a Lexorank value, and may have little meaning to people reading it in its encoded format.  That is, you could not tell from just looking at a value if something is the N-th value in a backlog.

 

Kind regards,
Bill

Michael Ball-Marian
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!
July 11, 2025

Thanks Bill!

We are using Jira Cloud. 

I appreciate the "why are you doing this" question. I should have provided that context up front. 

I want to use this query against a short, filtered list of JPD ideas. One example is a ranked list of ideas for the current quarter. We have some stakeholders who are not going to participate in detailed meetings - they just want to know if priorities are shifted. 

The messaging will not be noisy, "I know what I'm doing" in this case. 

Regarding this:

trigger only contains information about the changes which triggered the rule, and not a complete list of all changes over time.

I am not sure this is true, because when I use the condition I mentioned:

Condition: {{changelog.Rank}} does not equal Empty

The rule is triggered for every edit of the issue (e.g., a text edit to description). 

My initial thought was exactly what you said: that the changelog would only contain changes from the triggering edit. I will try outputting that as a string to see what is going on. 

Michael Ball-Marian
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!
July 11, 2025

I tested this, and the result is indeed empty for edits that do not include re-ranking. 

This leaves me puzzled...is "Empty" not the correct condition to check for? Null doesn't work either. 

Currently, my rule executes for every change, regardless of whether the condition is true or not. 

Bill Sheboy
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.
July 11, 2025

That is curious...time to test and verify!

When I just edited the Description in a JPD Idea, with a rule using Work Item Updated, the changelog did not contain the Rank field in all four ways I checked it:

  • write {{changelog}} directly to the log
  • capture the {{changelog}} as a variable to see its raw content, writing that variable to the log
  • write {{changelog.Rank.isEmpty()}} to the log (this shows as null when Rank is not in the changelog and false when it is)
  • use a smart values condition to test if {{changelog.Rank}} is empty

 

Then, I updated the Idea by only dragging it higher in the list to re-rank, and all four methods showed the Rank change.  And it only showed that specific Rank change, not the entire history.

Same when I did a status transition on a "board" view by dragging it to another status column.

Bill Sheboy
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.
July 11, 2025

Are you using a condition on the trigger (i.e., the new feature just added) or using a separate Smart Values Condition after the trigger?

Michael Ball-Marian
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!
July 12, 2025

 

Thanks Bill, 

I was using the condition as an IF condition, after the trigger (see my flow below). 

I don't think "Field Value Changed" will work for RANK?  The only way I can see to do it is to trigger on work item update, and then test for the condition using smart value?

 

 

SCR-20250712-oosq.png

Bill Sheboy
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.
July 12, 2025

You are correct on the trigger to use Work Item Updated when checking for a Rank change.

 

I notice you are using a different smart value than what I tested.  After a quick re-test I find:

  1. {{changelog}} is the one used with that trigger and contains data for the changed field(s)
  2. {{issue.changelog}} is an undocumented one, and my testing shows it contains no useful data...even though it is not "empty".  I do not know in what cases it will contain data in its {{issue.changelog.histories}} property with rules.

This appears to be another case where rules have similarly named, although different  purposed, smart values.  (Another example is {{sprint}} versus {{issue.sprint}} for the sprint-related triggers: the first one is for the trigger event and the second has all the issue's sprint values / history.)

 

Please use {{changelog}} for your condition to learn what happens.  Thanks!

Michael Ball-Marian
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!
July 14, 2025

@Bill Sheboy - I'm sorry - I was testing and changed that just to see if it made a difference. 

I get the same result as with {{changelog.Rank}}. The action ALWAYS triggers, even if rank was not updated. 

SCR-20250714-hnak.png

Bill Sheboy
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.
July 14, 2025

I just tested this again with Jira Cloud and it worked as expected: with the generic Work Item Updated trigger and the Smart Values Condition, the rule only proceeded when the Rank changed.

 

What action were you taking when the rule triggered?  That is, what happened to the work item?

 

There is a possibility the rule is "glitched".  That is, the rule's behind-the-scenes JSON is broken due to several update / publish cycles.  The way to check for that is:

  • disable this rule
  • re-create it from scratch
  • test again

 

There is also a very unlikely possibility: has someone created a custom field named Rank which is colliding with the built-in one?

You may check that using this how-to article to observe if there are multiple fields named Rank provided to the rule for work items:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Michael Ball-Marian
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!
July 14, 2025

 

To test this, I tried to different actions on the issue in Jira: I edited description and I changed the rank on a rank-ordered list. 

I expect that editing description should not trigger the rule, while re-ranked would. 

I continue to see the rule trigger in either case. 

I just tried:

  • Creating a new rule from scratch (didn't fix)
  • Double-checked, but we have only 1 field for Rank (it is the JIRA created /locked custom field). I see no other field for Rank. 

I have no idea at this point. 

When I look at the changelog via API, I can find the changes where I am editing text vs rank. The text edit changes do not include Rank changes. I am totally stumpped!

 

Michael Ball-Marian
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!
July 15, 2025

I figured it out, using a slightly different approach. Will post answer in a new comment.

Michael Ball-Marian
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!
July 15, 2025

@Bill Sheboy Thanks for your dedicated help! I appreciate it

Like Bill Sheboy likes this
0 votes
Marc - Devoteam
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.
July 11, 2025

Hi @Michael Ball-Marian 

Welcome to the community.

As mentioned in the related discussion, I agree with @Bill Sheboy .

Talk to your team, as this can be a disruptive action a a product owner or scrum master or service manager doing their work on arranging issues.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events