Task is not resolving

am using a simple resolvedIF funtion in my task configuration below but the form isn’t getting resolved

{
    name: 'care-assessment-task',
    title: 'Level of care assessment task',
    icon: 'immunization',
    appliesTo: 'contacts',
    appliesToType: ['person'],
    appliesIf: c =>  !c.contact.date_of_death && !c.contact.muted,
    actions: [{ form: 'care', }],
    events: [{
      start: 7,
      days: 0,
      end: 5,
    }],
      resolvedIf: function(c){
        return c.reports.some(function(r){
          return r.form === 'care';
        });
      }  
  }

I’ve split this off from another thread since it is tackling Tasks rather than Condition Cards.

1 Like

Reposting a relevant part from the previous thread:

For debugging this scenario I would take an approach similar to that mentioned earlier, and simplify the component to it’s basic parts and go from there. In this case, that means making sure the task shows up, which you’ve done. Next I would confirm that selecting the task opens the intended form. If that is working I would submit that form, and make sure that it clears the Task. It seems that form hasn’t been submitted in this case, which would explain why the task wasn’t cleared. If you have submitted it, but don’t see it on that contact, make sure the form has the person’s UUID included at the top level.

As an aside, the simplest resolvedIf function is actually to exclude it altogether so that it takes the default behaviour of resolving the task when the action form is submitted in the task window.

1 Like

thanks alot @marc ,works fine now

1 Like