Edit Default System Filters

Jenae Leahy January 15, 2013

Does anyone know how to edit a system filter (My open issues default filter that shows under Issues). There appears to be two concepts of 'My Open Issues'. One is a system filter as found in that issues menu and the other is a default, but sharable/editable filter. I cannot find a way to edit the system filter and it is returning an error because the 'resolution' concept has been removed from our fields. I need a way to edit the system filter so it no longer looks at the resolution field, but the status field. Any help is appreciated.

More Detail:

I am agreeing with GeorgeCC, I am looking for a way to change this globablly, but my larger issue is I cannot change it at the user level for the system filter.

Here are some screenshots to help.

So, on the screen you can see two filters for My Open issues. The highlighted top one is the system filter. The bottom one is the one that shows up when I search for filters which I can edit.

http://img35.imageshack.us/img35/3509/issuesfiltersselection.png

And, the when I select that system filter, I get the following error because the resolution field is hidden from all users. You can see on this filter I have no cog to edit it.

http://imageshack.us/a/img841/7929/issuesfilterserror.png

These results are from the 'my open issues' links under favorites (outlined in screenshot) which loads properly because it doesn't reference the resolution field. This one can be edited unlike the system filter.

http://img560.imageshack.us/img560/337/favoritefiltersmyopenis.png

Back to the original question, how I can edit the system filter? Thanks!

10 answers

3 votes
Stefan_Sonnenberg-Carstens December 7, 2018

Are you serious?

Why in the name of heaven and hell it is not possible to either

a) modify a filter and just click "save" and link that saved version to the logged in user

or

b) give admins a way to edit the default filters

?

JIRA is very good tool with great capabilities but these oddities make it really hard to love.

(I would also accept if it was necessary to update the DB directly for once ...)

2 votes
Damian Nowak November 9, 2013

You can't edit a built-in filter, which is hard-coded, but you can trick your HTML. When you click "my open issues", you will be redirected to a custom filter of your choice.

First of all, create a custom filter, share it with everyone and write down its ID, e.g. 10454.

Then paste this code as announcement banner at /secure/admin/EditAnnouncementBanner!default.jspa:

<style>
  #announcement-banner {
    padding: 0 !important;
    border: none !important;
  }
</style>

<script>

var filterId = 'CUSTOM FILTER ID HERE';

AJS.$(function() {
  var replaceUrl = function(link) {
    var $link = AJS.$(link);
    var url = $link.attr('href');
    if (typeof url !== 'undefined') {
      var newUrl = url.replace('filter=-1', 'filter=' + filterId);
      $link.attr('href', newUrl);  
    }
  };

  var selector = '#find_link-content a[data-filter-id="-1"], a.filter-link[data-id="-1"]';
  AJS.$(document).on('mouseover', selector, function() {
    replaceUrl(this);
  });

  AJS.$(document).on('click', selector, function() {
    document.location.href = AJS.$(this).attr('href');
    return false;
  });
});

</script>

For programmers: this replaces all occurrences of links matching the given selector. There may be other places where a link to the built-in filter appears, and my hack doesn't work. If you find such place, share your selector and I will include it.

Ozan Bayram August 8, 2017

Thanks this did the trick for me. I replaced the "Reported By Me" Filter 

Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2018

Hi@Ozan Bayram 

Can you tell exactly how it worked for you?

I tried the same and it's not working, and i really need this

 

EDIT:

This changed the "my open issues" filter, from the "issues" menu in the main Jira navigator.

I thought it will replace it in the "issues" panel on the left when you go in to the project page.

Is there a way to do it? @Damian Nowak3

Ozan Bayram March 15, 2018

Hi @Nir Haimov i just used the script to replace my "reported by me"  filter

For this issue. I created a new filter and get the id of it. And put into the script

Then i changed replace code for filter id "-2"

Then i added the script to admin panel > system > user interface >Announcement Banner

This changed both. Top menu and the left menu

Left menu

jira-menu-Picture1.png

Top menu

jira-menu-Picture2.png

Here is the final code

<style>
  #announcement-banner {
    padding: 0 !important;
    border: none !important;
  }
</style>

<script>

var filterId = '13209';

AJS.$(function() {
  var replaceUrl = function(link) {
    var $link = AJS.$(link);
    var url = $link.attr('href');
    if (typeof url !== 'undefined') {
      var newUrl = url.replace('filter=-2', 'filter=' + filterId);
      $link.attr('href', newUrl);  
    }
  };

  var selector = '#find_link-content a[data-filter-id="-2"], a.filter-link[data-id="-2"]';
  AJS.$(document).on('mouseover', selector, function() {
    replaceUrl(this);
  });

  AJS.$(document).on('click', selector, function() {
    document.location.href = AJS.$(this).attr('href');
    return false;
  });
});

</script>

Please note that there is two lines to replace

var newUrl = url.replace('filter=-2', 'filter=' + filterId);
  var selector = '#find_link-content a[data-filter-id="-2"], a.filter-link[data-id="-2"]';

 

 

Hope this helps.

Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2018

Hi @Ozan Bayram

I wanted to change the default filter inside the "issues" menu inside the project (see attached)

Couldn't find a way to do it... any suggestions?1.png

Ozan Bayram March 15, 2018

When i clicked that link it navigates to a link like this "?filter=myopenissues"

Maybe you could give a try to replace that one

but i dont think this is possible

Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2018

Yeah,

It's not possible, though you came up with a way to accomplish that 

Thanks any way :)

Alessandro Tondo April 5, 2018

@Damian Nowak3@Ozan Bayramis there a way to extend this workaround to the Switch filter dropdown menu?

2018040511_23_10.png

Ozan Bayram April 5, 2018

don't know but maybe same solution can be applied. Basically you need to find what do you want replace and change the script

Alessandro Tondo April 5, 2018

Thank you Ozan.

Actually I don't know where to search for the tags I need. Is there any documentation or something like that to search for them?

1 vote
Keri
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 24, 2016

Hi Everyone, 

I have opened a feature request for this: https://jira.atlassian.com/browse/JRA-63317 - please take time to vote and add your comments to this issue. 

Cheers, 

Keri Hannon | Atlassian Support

1 vote
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2013

Oh Jenae Leahy, please do not hide the resolution field in JIRA. Many things depend on that and I would really prefer to leave it untouched. What is the issue you are facing if you have it enabled.

And the system filter, it is not editable, I am guessing it is not in any database table, it is in code - https://answers.atlassian.com/questions/125565/how-can-i-change-the-my-open-issues-filter</span<>>

Jenae Leahy February 22, 2013

Renjith, thank you for your reply. Sorry for the tardiness of mine, it has been a busy month. We prefer to hide the resolution field because it hads an extra step for the users for how they utilize JIRA. They must not only close it, but fill in a form related to resolution. For our uses, this is an uncessary step and just takes time. If I could set one resolution option and have it automatically assigned when clicking our closed status, that would be fine. Is there a way to do that?

Tansu Kahyaoglu March 5, 2013

Hi Jenae,

Install JIRA Suite Utilities and then you can add Update Issue Field as post function. Select Resolution and add it as Post Funtion.

BTW, I still need to change system default filters same reason you had. It appears I can't.

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 5, 2013

Same as what Tansu said, but it does not require any plugin. JIRA itself has the option to Update Resolution during a transition in the post-function and you can avoid the extra step being done by users. So in whichever worflow transition you think that the issue is actually resolved, just set that value to any pre-fixed resolution field in the post function.

0 votes
Adnan Haider February 26, 2014

Thanks Domian Nowak, its pretty good script. but i need When i click "Assigned To Me", in Project Issues Panel Pre filter selection it redirected me to a custom filter of my choice.

0 votes
Tansu Kahyaoglu March 5, 2013

Hi Jenae,

Install JIRA Suite Utilities and then you can add Update Issue Field as post function. Select Resolution and add it as Post Funtion.

BTW, I still need to change system default filters same reason you had. It appears I can't.

Edit: Oh, I missed OnDemand tag. I'm not sure this works for OnDemand

0 votes
Jenae Leahy January 29, 2013

Does anyone have any idea here. I am pretty sure I laid out the problem pretty clearly in my comment below, but I will update the main post. Help!

0 votes
Jenae Leahy January 17, 2013

I am agreeing with GeorgeCC, I am looking for a way to change this globablly, but my larger issue is I cannot change it at the user level for the system filter.

Here are some screenshots to help.

So, on the screen you can see two filters for My Open issues. The highlighted top one is the system filter. The bottom one is the one that shows up when I search for filters which I can edit.

http://img35.imageshack.us/img35/3509/issuesfiltersselection.png

And, the when I select that system filter, I get the following error because the resolution field is hidden from all users. You can see on this filter I have no cog to edit it.

http://imageshack.us/a/img841/7929/issuesfilterserror.png

These results are from the 'my open issues' links under favorites (outlined in screenshot) which loads properly because it doesn't reference the resolution field. This one can be edited unlike the system filter.

http://img560.imageshack.us/img560/337/favoritefiltersmyopenis.png

Back to the original question, how I can edit the system filter? Thanks!

0 votes
George Carvill
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2013

I don't see how this changes the behavior of the system filter, "My Open Issues," for everyone.

Ozan Bayram August 8, 2017

The filter must be shared to everone. Otherwise the link stays the same

0 votes
AgentSmith
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2013

Greetings,

I extracted the following information from https://confluence.atlassian.com/pages/viewpage.action?pageId=185729481

....

System filters (My Open Issues, Reported by Me, Recently Viewed, All Issues) and your favourite filters are shown in the issue navigator. You can also find and run issue filters via the 'Manage Filters' page (see Managing your filters section below).

To perform a saved search in the issue navigator:

  1. Choose Issues>Search for Issues.
  2. Choose a filter from the filters listed on the left of the issue navigator. You will be able to choose a filter, as follows:
    • Choose a system filter —My Open Issues, Reported by Me, Recently Viewed, All Issues
    • Choose a favourite filter — Your favourite filters(listed alphabetically)
    • Search — Click the Find Filters link to search for a filter. You can search for any filter that has beenshared with you,then subscribe to it as a favourite. Once you have subscribed to a filter, it will be listed in under Favourite Filters.
  3. Once you have chosen an issue filter, the search results for the filter will be displayed. The search criteria for the filter will also be displayed.
    (info) If you choose the 'Recently Viewed' system filter, the issue navigator will switch to the advanced search. This is because basic search cannot represent the ORDER BY clause that is used in the 'Recently Viewed' system filter.
  4. You can add, remove or modify the search criteria if you want to refine the search results. You can also save the modified search criteria (if you are updating your own filter), or save a copy of the search criteria as a new issue filter.

...

Let me know if there are any questions.

Cheers,
Jason | Atlassian

Suggest an answer

Log in or Sign up to answer