Hi
How do I know when a custom field was last updated using the REST API?
Sample case:
Using the Jira Cloud REST API, how can we know that a custom field has been updated?
It seems Jira Server gives this information, the database "lastvalueupdate" column is exposed in API as "lastValueUpdate
": https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/customFields-getCustomFields
Since issue's "updated" date does not change too (in the sample case, the issue ISS-1 still shows "2024-05-01" as last update date), how can we get this change information using REST API?
If you've ever considered asking me to retrieve the options for each custom field: this is a per custom field endpoint and most of our customers have 1000+ fields, so you can guess how many calls it needs.
Hello @Nicolas SANDRI
Using the Jira Cloud REST API, how can we know that a custom field has been updated?
You can't. The Cloud version of Jira doesn't log changes made to the values of custom fields the way that the Data Center version does.
The lastValueUpdated object is used as part of Jira Data Center's Analysing Custom field usage feature and the broader management of custom fields. Those features don't exist in the Jira Cloud environment.
Hello @Sunny Ape
I am so disappointed to have to resign myself to not having a solution to this problem.
How can Atlassian miss this point, since custom fields are one of the most used features in Jira? Having creation and update timestamps is so common that it is an essential feature for any REST API, no matter how small.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to consider the scope of what is involved.
For the Data Center product, those change events are logged into the system event log file. The responsibility of managing the size of that log file and any costs associated with its storage is borne by the owner of Jira DC instance as part of the operational costs.
For the Cloud product, all operational costs are borne by Atlassian. Imagine the scope of having to store such change events in the system logs for hundreds of thousands of instances of Jira. There would be possible hundreds of millions of such change events to log per day and keep for what the customer assumes is forever.... so, they don't do it.
However, all that aside, a Sys Admin can enable activity auditing in Jira Cloud, which does log events related to changes to custom fields, then you can use the Get Audit Records endpoint to get the information you're looking for.
Be warned, the audit logs are retained for a maximum of 180 days (6 months). They are dense and time consuming to search through and parse via the REST API!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your detailed answer.
We have a Jira application in the Marketplace so our customers are mainly using Jira Cloud.
We don't need to have access to the changelog, we only need to know which custom fields have been changed since the last loading. Another way to accomplish this could be using issue’s values but since "updated" timestamp remains unchanged, we have no solution to get our customers changes.
A simple "updated" timestamp (or "valuesUpdated") containing the last update date would suffice: one more column on the table so not a big amount of data for Atlassian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you built your app with Forge, then it's time to consider having it subscribe to listen to the avi:jira:updated:field
custom field event, then logging any such changes in a Forge Storage object. Log the customer's changes yourself in your app :)
This topic is outside the scope of this forum. You and your Dev team should be using the Developers forum instead.
Have fun!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Our application is not built with Forge since we started development before Forge launched. I take note of your advice and we'll incorporate it when we rewrite it for Forge.
And we cross the fingers that Atlassian make an evolution to REST API v3!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.