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

inconsistent scripted field values

Description

*This issue has moved*

This issue has been moved permanently to Adaptavist's Product Support JIRA instance.

All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.

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.

Environment

JIRA v7.*

Status

Assignee

Mark McCormack

Reporter

Thanos Batagiannis [Adaptavist]

Labels

Internal Complexity

Unknown

Internal Value

Unknown

Affects versions

4.2.0.5

Priority

Major