Can internal mantis URLs directly point to custom filters?

Post about your customizations to share with others.

Moderators: Developer, Contributor

QAbe

Can internal mantis URLs directly point to custom filters?

Post by QAbe »

Hi folks!

I have defined filters in mantis, i'd like to be able to send email and provide a URL (with the right parms) that would open the user browser and go directly in mantis and trigger the desired filter.

Scenario:
For project: All Projects
I have a custom field called: Target Release
...and I tag my tickets to their respective release name, in this example: R10
...then I created a public filter, for all projects, filtering on Target Release "R10"

This works great within mantis, in the View Issues panel.

Once the filter is active, I can't see a usable URL on the URL bar, the shown URL does not contain any parms to let me play & try.

I have a feeling we can do similar thing as I can have a URL pointing on a specific bug id: http://bugtrk.prv.6d.com/mantis/view.php?id=1172
or a URL pointing on this same bug id's history:
http://bugtrk.prv.6d.com/mantis/bug_vie ... =1#history

Just wondering what parms to use, and if it's possible to do it like in my described scenario.

Tkx all!
Guest

Post by Guest »

*bump*
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

I just had a quick look at the view_all_bug_page and worked this out. In real life, it may not be useful, especially when it comes to requiring logins before viewing and so on, but it's a start.

I had a stored query whose ID was 1234 (for example). I sent my browser directly to:

http://servername/mantis/view_all_set.p ... id=0001234 and it seemed to work.


Hopefully that's useful enough.
Lincoln.
QAbe

Post by QAbe »

Thanks for the hint!

If I understand well, this is an url to point to a specific bug id.

But I need an url to point on a specific filter name.

Thanks for pointing the fact that I need to be logged in ahead.

Regards!

QAbe
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

You are talking about stored filters, right?

The code as it stands will not support sending a user to a specific stored filter by name, but that query that I gave you will send a user to a specific stored filter by ID. Replace source_query_id with the actual filter ID you want to use, obviously.

Basically that link is exactly what your browser will send you to if you select a stored query from the dropdown list.
Qabe

Post by Qabe »

thank you for the reply!

where could I find the cross reference between my filter names and their respective id numbers, which i can use on an url?

it's not on the GUI side under manage filters, perharps in a file somewhere?

many thx

QAbe
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

Hi Qabe,

It's in the database in the filters table (named 'mantis_filters_table' by default).

It's probably easiest to just do what I did: go to view_all_bug_page.php and make sure that you have the filter you want available in the dropdown list. Then, view the page source and find where that dropdown is written up and you'll see the list there in the form:
<option value="filter_id">filter_name</option>

Then just use the filter_id from there. Or, you could look in the database, whichever you want...

Lincoln.
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

An easier way to get the link is to do the following:

- Go to the View Issues page.
- Click manage filters.
- Right click on the filter you want and copy short cut.
- Paste the shortcut whereever you want.

Regards,
Victor
Mantis Blog
http://www.futureware.biz
QAbe

Yeah! 1 last thing...

Post by QAbe »

Yeah! it works! thanks!

Now, I noticed that when I use this URL:
http://bugtrack.priv.8d.com/mantis/view ... ery_id=151

The tickets shown are as per the currently selected project.

So if this project did not have tickets in this filter, I have an empty list.

Is there an additional parm I can use get to the 'All Project' level?

Best regards,

QAbe
QAbe

Post by QAbe »

*bump*
QAbe

Post by QAbe »

!xmas bump!
QAbe

Post by QAbe »

any1 can help please?
need a url parm to set mantis level to "all projects"
thx
QAbe

Post by QAbe »

*help bump*
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

I believe the answer is "not out of the box".

If you change the view_all_set.php code to accept a project ID you might be able to use the helper_set_current_project function to change the project ID for you, although I tested this a while ago and couldn't quite get it to work.

By the way (with no offence intended and not knowing the thoughts of other forum users) I find the whole 'bump'ing thing really annoying.

Sometimes you'll get lucky (like at the start of this thread) but most of the time, more than one bump is just rude. Well, as far as I'm concerned, anyway.
QAbe

Post by QAbe »

any1 can help me on this plz?
Post Reply