Get total hours by fixed version REST API
I just started using api redmine,
I am looking for can I have total hours by version
like i have version named 'updateredmine':
i wanna get the total hours spent in this version
Version 'updateredmine' | Total hours = 4924.00 hours
Hi, you can use python-redmine to simplify Redmine API work.
Here is a basic script that sums the spent hours for each ticket in a version (you must pass project_name and version_name):
$ ./total_hours_per_version.py my_project 1.1.0 total_hours: 7.0
Hello Mayama and thanks for your replay
I execute the scripte but i get this message error :
Traceback (most recent call last):
File "total.py", line 28, in <module>
version_id = [x for x in proj.versions if x.name == version].id
IndexError: list index out of range
As I said, that was a basic script and it will work as long as data passed to it is correct.
The error is happening because it tried to find a version by name but the project specified doesn't have such version.
This could happen for example if the version is named 'UpdateRedmine' but you pass 'updateredmine' to it.
Assuming this is the problem, I have adjusted the script to ignore uppercase/lowercase: