Hello,
How can I get the time spent (the sum of all issues) for a specific project, using script fields?
The documentation uses hard-coded filters like project's key or issue's status, as you can see at ( https://confluence.deiser.com/display/PROFIELDS49/Script+Examples ), and my doubt is how can I dynamically access these information in order to create a script field and use it as a column at Project Navigator screen, as displayed at ( https://www.deiser.com/profields ), like in that first picture, which probably uses the project time spent for the relative row, to display it at column "Spends".
Any hint?
Thanks,
Hi @Amílcar Rodrigues,
If what you need is the sum of the values of all issues in your project, you don't need to script anything. Just use a summative field and what the origin issue custom field is.
You can see the full instructions here, I think the example is exactly what you're trying to do.
If what you need is more elaborate, feel free to raise a ticket!
Thanks Jaime !
I work with Amilcar - and I was able to obtain Original Estimate, Time Spent, Remaining Estimate as cumulative values for projects - which is really cool !
We would like to get to the next level :-) and calculate some combined values:
Estimate at Completion (EaC) = Time Spent + Remaining Estimate.
Also Overrun% = [Time Spent + Remaining Estimate - Original Estimate] / Original Estimate
I guess it will not be as easy, and for this we will need script fields?
Thank you for your help!
Hi @Dan Florea !
Glad I was able to help. Yes, you'll need script fields for the remaining values you want to calculate.
Unfortunately scripting is beyond my skillset, but a colleague might be able to help. If you raise a ticket, we can support you over there.
Hello @Jaime Capitel
Thank you for feeding this thread. @Dan Florea and me worked around this.
Basically, the data required above, you can retrieve it from each project's issues.
You get specific project's issues like that:
def projectId = project.getId()def issueIds = issueManager.getIssueIdsForProject(projectId)def issues = issueManager.getIssueObjects(issueIds)
You have "issues" like a collection. All you need is to iterate over it, use inherited methods to get information, and store them in another proper data structure (e.g. ArrayList), like:
def originalEstimateList = new ArrayList<Long>()def timeSpentList = new ArrayList<Long>()def remainingEstimateList = new ArrayList<Long>()issues.each { originalEstimateList.add(it.getOriginalEstimate()) timeSpentList.add(it.getTimeSpent()) remainingEstimateList.add(it.getEstimate())}
No need of any import. All you need is already there, just copy and paste.
Reference: https://docs.atlassian.com/software/jira/docs/api/7.6.0/overview-summary.html
It looks like you're new here. Sign in or register to get started.