-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question of Issues #27
Comments
Hello, Han! If you need to access the parent issue of the issue you have to use the >>> from redmine import Redmine
>>> redmine = Redmine('http://your-redmine.url', username='jsmith', password='foobar')
>>> issue = redmine.issue.get(12345)
>>> dir(issue)
['attachments',
'author',
'changesets',
'children',
'created_on',
'custom_fields',
'description',
'done_ratio',
'id',
'journals',
'parent', <---------- here it is
'priority',
'project',
'relations',
'spent_hours',
'start_date',
'status',
'subject',
'time_entries',
'tracker',
'updated_on',
'watchers']
>>> issue.parent
{'id': 54321} But if an issue doesn't have a parent issue, then the issue.parent
project.parent etc., it returns a dict, and not a resource object as it should, this is a bug in the python-redmine and will be fixed in the version. That means that you have to manually fetch the parent issue like that parent_issue = redmine.issue.get(issue.parent['id']) If you need to access the children issues from a parent issue you can call issue.children which return a ResourceSet object of children issue resources if any |
The bug with |
v0.8.1 with a fix released to PyPI. |
Thank you for your explanation. I selected the wrong Issue which didn't have Parent. After switching to the right one, I could see Parent. And I am happy that my question - accidentally - could contribute to python-redmine :) |
Hi,
I would like to access "parent_issued_id" in a single issue in order to collect Issues according to their parent Issues. However, I cannot find that
attributes in Issue. I am a novice of Python and Redmine. Here is my code
As you expect,
I was trying to look at resource.py, and realized quickly to ask this question to developers.
Thanks,
Han
The text was updated successfully, but these errors were encountered: