python-redmine icon indicating copy to clipboard operation
python-redmine copied to clipboard

Filter by relations?

Open supermitch opened this issue 4 years ago • 1 comments

The Redmine GUI can filter issues "Related to" with many options:

image

Are these options available via the API or Python-Redmine? I have searched everywhere and can't find anything.

I know I can include relations, but these relations are just other issue IDs. I still wouldn't be able to manually do "... in project" filtering without a second get for that individual issue, to determine which project it's in. Right?

supermitch avatar Jul 13 '21 22:07 supermitch

I can partially answer my own issue (that I forgot I'd created): By URL decoding a UI query URL, I was able to discovery that you can add 'relates': '!*' in your query, and you will filter out issues with relations. For example:

redmine.issue.filter(
        **{
            'tracker_id': 20,
            'status_id': '*',
            'relates': '!*',
            'include': 'relations',
        }
)

seems to be working. I haven't experimented with other relates queries, but this seems to return only issues without relations.

supermitch avatar Feb 11 '22 00:02 supermitch

Hi @supermitch

Apologies for the delayed answer and thanks for posting your solution which is absolutely correct.

You can find other possible relate operators here.

There's additional information regarding tricky uses of operators in other resources in #57 and #205. I really need to find some time and add all these pieces of knowledge to the docs.

maxtepkeev avatar Jan 07 '23 12:01 maxtepkeev