Hi,
I'm trying to develop a script to get the last value of the field "Remaining estimate" before a specific date (custom field). The script should get the value based on the date of the last log work.
We developed the script below, but we could only get the value of WorkID. Could you help me?
import com.atlassian.jira.ComponentManager import com.atlassian.jira.component.ComponentAccessor def cont = 0 def inicio = 0 def log = 0 def date = new Date(01-01-2001) def ref = getCustomFieldValue("Data de Referência") as Date def worklogManager = ComponentAccessor.getWorklogManager() def componentManager = ComponentManager.getInstance() def changeHistoryManager = componentManager.getChangeHistoryManager() def alvo = changeHistoryManager.getChangeItemsForField(issue, "WorklogId") ListIterator alvo_itr = alvo.listIterator(); while(alvo_itr.hasNext()) { cont += 1 alvo = alvo_itr.next(); result = alvo.getFrom() as Long inicio = worklogManager.getById(result).getStartDate() as Date criacao = worklogManager.getById(result).getCreated() as Date if (inicio <= ref) { if (criacao >= date) { log = result date = criacao } } } return log as String
Thank you
I don't really understand the question. Worklogs are stored separately from the issue. Remaning estimate is calculated based on the time remaining on subtasks, so to get it at a point in time you would need to know the subtasks as of that time, and their remaining estimate as of that time.
Sorry. Actually, we need to get the "time remaining" value from sub-tasks of a specific date. We need to get to "estimate time" value related to worklogID we got.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I could see, the script is actually returning the correct value, but it seems to be "expected" some sort of update behavior in order for that value to be available for use in other/subsequent context (e.g. in a query)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamie Echlin [Adaptavist] Can you help us? We need to get the resulting timeestimate the worklogId found?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.