We're updating the issue view to help you get more done.Learn more

inconsistent scripted field values

 

Steps to reproduce


Create Scripted field with

 

  • Searcher: Number Searcher

  • Template: Number Field

  • Script

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.history.ChangeItemBean import com.atlassian.jira.component.ComponentAccessor enableCache = {-> false} Issue issue = issue def changeHistoryManager = ComponentAccessor.getChangeHistoryManager() def inProgressName = "In Progress" Double rt = 0 changeHistoryManager.getChangeItemsForField (issue, "status").reverse().each {ChangeItemBean item -> Double timeDiff = System.currentTimeMillis() - item.created.getTime() as Double if (item.fromString == inProgressName) { rt = rt - timeDiff } if (item.toString == inProgressName){ rt = rt + timeDiff } } log.debug("Time in progress for issue ${issue.key} - ${(rt / 1000 / 60) as Double} sec") (Math.round(rt / 1000 as Double) / 60) as Double

    Value of 'active' (in the above script an issue in progress) scripted field when refresh the agile-board or issue view screen, is inconsistent. Re indexing fixes the problem temporary.

Status

Assignee

Mark McCormack

Reporter

Thanos Batagiannis [Adaptavist]

Labels

Internal Complexity

Unknown

Internal Value

Unknown

Affects versions

4.2.0.5

Priority

Major