Hi ,
I am using Jira Data center. I have a requirement to pull the history data of a custom field.
Requirement: Pull the data of custom field where the field value changes from A to B in the year 2025.
Jql does not support to pull the history data for custom fields. Is there any way to get this data using script runner?
Any recommendations would be helpful.
Thank you
Hi @G P N!
You are right, JQL can't query historical values of a field, only the current value.
If you are open to third-party apps, I recommend the Issue History for Jira (Work Item History) app by SaaSJet. It is supported on Jira Data Center and allows the generation and export of reports covering the full history of tasks (including their custom fields).
In the app, you can use the project filter, set the date range to 2025, select a specific custom field, and track and export all field transitions, including old and new values.
The report shows the exact change (from value → to value), the date, and the author of the change. You can then export the results to Excel/CSV for audit or further analysis.
This approach allows you to avoid custom scripting and repeated changelog scans.
Hi @G P N
You could try using the ChangeHistory to pull the modifications made to a specific field.
Below is a sample code for your reference:-
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def changeHistoryManager = ComponentAccessor.changeHistoryManager
final def numberFieldName = 'Sample Number 1'
def sampleNumber = customFieldManager.getCustomFieldObjectsByName(numberFieldName).first()
def sampleNumberValue = sampleNumber.getValue(issue)
def changeHistories = changeHistoryManager.getChangeHistories(issue)
if (!sampleNumberValue && changeHistories.size() == 0) {
0
} else {
changeHistories.collect { changeHistory ->
def result = changeHistory.changeItemBeans.find {
it.field == numberFieldName
}
def value = result['toString'].toString()
value ? Long.parseLong(value) : 0
}.sum()
}
Please note that the sample working code above is not 100% exact to your environment. Hence, you will need to make the required modifications.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You’re right — standard JQL in Jira Data Center cannot query historical changes for most custom fields. However, this can be achieved using ScriptRunner.
ScriptRunner provides JQL functions that can search the change history, including transitions from one value to another within a specific date range.
Option 1 — If the field is supported by ScriptRunner history functions
Try using:
issueFunction in fieldChanged(
"Your Custom Field",
"from 'A' to 'B' after '2025-01-01' before '2026-01-01'"
)
This returns issues where the field value changed from A to B during 2025.
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.