You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello!
I need some help with grabbing the date (yyyy-mm-dd) of the last time a custom field was updated, nothing fancy just the date to display it on a dashboard for managers.
I appreciate the help.
Hi @Jorge - Jira does not provide a native mechanism to query against history so you'd need a 3rd party tool like script runner.
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.
Hi Judah,
I used a script field:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jorge Thanks for sharing your code! I also used a SR Scripted Field: Date Time Range picker, Custom template (so I could manipulate the date format), I also added some logic to hide the script field if another field has no value.
Custom Template:
$datePickerFormatter.withStyle($dateTimeStyle.DATE).format($value).toString()
Script:
import com.atlassian.jira.component.ComponentAccessor
// To get the Status Comments field
def statusCommentsField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName('Status Comments')[0]
// To get the Status Comments field value for an issue
def statusCommentsValue = issue.getCustomFieldValue(statusCommentsField)
// To get the Status Comments field's changes
def lastComment = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue, 'Status Comments')
if(!statusCommentsValue){ // If Status Comments field is empty or has no value
return null
}else{
if(lastComment){ // If the Status Comments field has change history record(s)
return lastComment.last().getCreated()
}
}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.