I am trying to find the Jira database table that stores a scriptrunner custom field. We are calculating the time an issue is in one of the statuses of the projects work flow. Below is the script that is running to calculate the amount of time in that status. I have the field in the customfield table but no values are in the customfieldvalue table.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def inProgressName = "1: Gap Analysis Assessment"
List<Long> rt = [0L]
def changeItems = changeHistoryManager.getChangeItemsForField(issue, "status")
changeItems.reverse().each {ChangeItemBean item ->
def timeDiff = System.currentTimeMillis() - item.created.getTime()
if (item.fromString == inProgressName) {
rt << -timeDiff
}
if (item.toString == inProgressName){
rt << timeDiff
}
}
def total = rt.sum() as Long
if (total == 0) { return null}
else return (total / 1000) as long ?: 0L
There isn't one. The result from a scripted field is not stored, like a lot of other stuff Jira shows you.
Your question leads me on to something else though. Why are you asking this? Why are you looking at the Jira database?
I ask that because SQL is the single worst possible way to get any information out of Jira, and there is always a better way to do it. What are you trying to achieve here?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.