cancel
Showing results for 
Search instead for 
Did you mean: 

filter task based on type in my-tasks page

leftright
Champ on-the-rise
Champ on-the-rise
I want to use a filter on my tasks page(and also a dashlet), that would display only the user tasks of a certain type.
If I understand correctly, this is the way in which filter are added.


<config>
   <max-items>50</max-items>
   <filters-parameters>
      <!–
         Turns the filters form the filter's config files into url parameters by matching the filter id and data against
         the filter patterns below. A wildcard ("*") matches any value as long as it exists and isn't empty.
         The parameters will later be added to the end of the base repo webscript url used to retrieve the values.

         Note that it is possible to create dynamic values by using the following keys inside "{}":
          * {id}   - resolves to the filter id value
          * {data} - resolveds to the filter data value
          * {0dt}  - resolves to a iso08601 datetime representation of the current date and time
          * {0d}   -  resolves to a iso8601 date representation of the current day
          * {-7d}  -  resolves to a iso8601 date representation of the current day rolled the given number of days back
          * {+7d}  -  resolves to a iso8601 date representation of the current day rolled the given number of days forward
      –>
      <filter id="all"           data=""             parameters=""/>
      <filter id="due"           data="today"        parameters="dueAfter={-1d}&amp;dueBefore={0d}"/>
      <filter id="due"           data="tomorrow"     parameters="dueAfter={0d}&amp;dueBefore={1d}"/>
      <filter id="due"           data="next7Days"    parameters="dueAfter={0d}&amp;dueBefore={8d}"/>
      <filter id="due"           data="overdue"      parameters="dueBefore={-1d}"/>
      <filter id="due"           data="noDate"       parameters="dueBefore="/>
      <filter id="priority"      data="*"            parameters="priority={data}"/>
      <filter id="assignee"      data="me"           parameters="pooledTasks=false"/>
      <filter id="assignee"      data="unassigned"   parameters="pooledTasks=true" />
      <filter id="state"          data="*"          parameters="state=completed" />
   </filters-parameters>
</config>

So if I want to get tasks of a certain type, which parameters do I have to set in filter. What about data.
Or do I have to do  something/anything else to filter task types.
Thank you for answers.
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
This is the section from the wiki page for customizing the task to do dashlet.

To create or remove a filter in one of the filter sections simply override the filter's config file AND the task or workflow lists' config files in the web-extension folder and add or remove a filter element. Make sure to match the filter id and data attributes in both files and supply the appropriate url parameters in the parameters attribute and don't forget to also add the filter's i18n key in the .get.properties file.

Hope this helps.

leftright
Champ on-the-rise
Champ on-the-rise
I have found the filter parameter I need, it is called exclude( excludes task types from the list ).

The only problem is that it is not working for me.
What would be the exact syntax for this parameter.

Lets say I want to hide task called ocrSmiley SurprisedcrFinished
I have tried things like


<filter id="excludeTest"          data="*"          parameters="exclude={ocr:ocrFinished}" />
<filter id="excludeTest"          data="*"          parameters="exclude=ocr:ocrFinished" />
<filter id="excludeTest"          data="*"          parameters="exclude=[ocr:ocrFinished]" />
<filter id="excludeTest"          data="*"          parameters="exclude=(ocr:ocrFinished)" />

I have defined a filter for paramater   status=completed   correctly,
so I think I am not using the right syntax for exclude inside parameter attribute.

bellahf
Champ in-the-making
Champ in-the-making
I am doing something similar trying to list tasks in the Not Yet Started status but I was only able to list tasks with parameter state=completed and don't seem to make status=completed to work:

      <filter type="pendingTasks"          parameters="state=completed"/>

How can I use status as parameter?

I just learned that I need the filtering to be done in the client side instead of the server side, any pointers?
Thanks

leftright
Champ on-the-rise
Champ on-the-rise
Ok, after a long time I resumed work on this again and I have found out the problem.
There was already an exclude attribute in the request URL.
This attribute receives its value based on the hidden tasks config.
Even if there are no tasks specified to be hidden in the config file, this attribute is still in the URL with NO value
and since it comes before the other exclude attribute( from filter configuration ), it is the only one picked up by the webscript.
I corrected this by changing some javascript files. So could this be considered a BUG perhaps??

Now I have another problem. I can succesfully add my custom filter( filter itself works correctly ), but I cant
add this filter to a new filter section. So what do I have to do in order to create a new filter section?