Journey Overview Task Counter not filtering Completed/Remaining Tasks

aguanci
Tera Expert

Hi All,

 

We are trying to add 2 new counters/filters to the JNY Journey Details Widget - Tasks Remaining and Tasks Completed. We can achieve the correct count of each but when the user clicks on the number it is not filtering correctly. When clicking on the counter the task list below is supposed to filter on either Tasks Remaining or Tasks Completed. 

 

We also tried comparing what we created based on the counter/filter that does work, which is Due Soon. Unfortunately, we are unable to see a difference. 

 

Example of Counter/Filter working:

aguanci_2-1703272355306.png

 

*Note that it only shows Tasks Due Soon

 

Here is what our Custom Counter/Filter produces:

aguanci_1-1703272320794.png

*Note that no filter is applied in the picker so it is showing all tasks. 

 

Here is the portion of the script where we are able to get the correct count:

// Function to count the # of completed tasks
    c.countCompletedTasks = function() {
        var count = 0;
        for (var i = 0; i < c.tasksUsersNStages.taskList.length; i++) {
            var task = c.tasksUsersNStages.taskList[i];
            if (task.state_num_value == '3' && task.state_num_value != '9')
                count++;
        }
        return count;
    };
    // Function to count the # of tasks remaining 12/19/23
    c.countRemainingTasks = function() {
        var count = 0;
        for (var i = 0; i < c.tasksUsersNStages.taskList.length; i++) {
            var task = c.tasksUsersNStages.taskList[i];
            if (task.state_num_value != '3'  && task.state_num_value != '9')
                count++;
        }
        return count;
    };
Could someone please help steer us in the right direction? Please let us know if anymore of the Client Script should be provided. 
1 REPLY 1

Joseph Caudle
Tera Contributor

I am not trying to build a custom filter, but have found that the type filtering does not behave as I would expect. I'm going to be opening a HI ticket for clarification, but was curious if you ever got any further on this.