Forums

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

How to get the History data for a custom field?

G P N
February 16, 2026

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

3 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Natalia_Kovalchuk_SaaSJet_
Community Champion
February 17, 2026

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). 

jira-dc-reports.pngIn 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.

 

 

 

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
February 17, 2026

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

 

 

0 votes
Prasanna Ravichandran
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 Champions.
February 16, 2026

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.

TAGS
AUG Leaders

Atlassian Community Events