Can I query the change log without a change trigger?

Dancey Apple November 20, 2024

I'm trying to pull the previous value of a custom field that has already changed using automation. This is on Data Center.

Does this only work when the rule is triggered by a change?

I'm using {{#changelog.[fieldname]}}{{fromString}} to {{toString}}{{/}} to try and search based on automation documentation, but I'm not getting any results. 

Snag_2785503.pngSnag_2792ad2.png

1 answer

1 accepted

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 21, 2024

Hi,

It seems that you can only access to the smart value "field change" using an update trigger.

 

One solution could be to use the REST API in Automation

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.
November 23, 2024

Hi @Dancey Apple -- Welcome to the Atlassian Community!

Adding to the suggestions from @Mohamed Benziane ...

If you try using the REST API endpoint to get the changelog, you could run into the limits for how many entries are returned for each call.  And so if your issue is updated often and the assignee changed more than 100 "changes" ago, your rule would be quite complicated.

 

What problem are you trying to solve by doing this?  That is, "why do this?"  Knowing that may help the community to offer other solution approaches.

 

Kind regards,
Bill

Dancey Apple November 26, 2024

Hey @Bill Sheboy and @Mohamed Benziane Thanks for the suggestions! 

The goal is to plug the old value of the field into a new field. 

We have a field called Remaining Hours that was zeroed out by another automation. We want to grab the previous value and plug it into a new field called Estimated Hours.

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.
November 26, 2024

Is this a one-time fix or a re-occurring one?

  • one-time fix
    • I recommend reviewing the issue change log / history and updating the field manually
  • re-occurring fix
    • First thing, review the other automation rules to prevent them from clearing the field
    • As I noted earlier, when the field was cleared is important, as the REST API cannot return all the change history to find the field clearing.  If the clearing happened within the last 100 issue updates, a single call to the REST API should reveal the prior value.  If not, the rule changes are much more complex, as it is likely a recursive rule with an Incoming Webhook trigger will be needed to solve this.

 

Dancey Apple November 27, 2024

Yes, we've already addressed the automation that zeroed out the value. This was all a part of a migration from one project to another. 

I think it was only a single change, but thanks for the heads up about the last 100 updates. I'll try the REST API route. 

Thanks Everyone!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer