Comments (2)
Hi,
Yes, you are right. Unfortunately we can do nothing about it because this is how the custom fields filtering works on the Redmine side and Python Redmine is just the interface for the Redmine API.
So one thing that you can do is to fill a bug report on the Redmine forum and probably they will fix it some day. Until they fix this behaviour you can check the custom field flag to make it work for all projects and not just the specific one(s), this way issue filtering will work as you expect.
Probably another thing you can do is something like
for project in redmine.project.all():
issues = redmine.issue.filter(project_id=project.id, subproject_id='!*', cf_1="random")
issue_count = len(issues)
if issue_count > 0 and issues[0].custom_fields.get(1) is not None:
print 'Project {0} has {1} issues with custom field with an id of 1'.format(project.name, issue_count)
else:
print 'Project {0} has no issues with custom field with an id of 1'.format(project.name)
Of course this is a dirty workaround around the Redmine API behaviour but it should work. Also keep in mind that I haven't check this code but again, it should work.
from python-redmine.
Sorry there was a logical error in my code. I updated my previous comment with the correct version. Though it's not the complete solution to your problem, e.g. it doesn't check for a specific value for a custom field, but you should get the general idea about how you can accomplish what you need.
from python-redmine.
Related Issues (20)
- tags from task HOT 2
- check the existence of a task HOT 1
- Copy project HOT 2
- Is it possible to integrate a "geojson" parameter in issue creation? HOT 2
- KeyError: 'time_entry' HOT 3
- Cant Set priority_id HOT 5
- When adding a user to a group that they are already a member of get "User is invalid" HOT 2
- How to: Create Issue onbehalf of another user HOT 4
- Bug: User does not return status HOT 3
- Bug: Users.all() does not return all users HOT 4
- When querying resources, why is there a default_includes HOT 2
- Leaks API key on exception HOT 2
- Filter by application subject HOT 2
- BytesIO is not JSON serializable HOT 4
- ResourceNotFoundError: Requested resource doesn't exist HOT 2
- Get Request - ResourceNotFoundError: Requested resource doesn't exist HOT 2
- filter error HOT 2
- ???????? for Russian text HOT 6
- adding custom fields to project HOT 2
- Get member users from project_membership HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-redmine.