

# Create a rule in Contact Lens that ends associated tasks from a case
<a name="contact-lens-rules-ends-tasks"></a>

**To create a rule that ends associated tasks**

1. When you create your rule, choose **A new case is updated** as the event source.  
![\[The new rule page, the add action dropdown menu, the a case is added option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-lens-rules-update-case-1.png)

1. When you create your rule, choose **End tasks** for the action.  
![\[The new rule page, the add action dropdown menu, the end tasks option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-lens-rules-ends-tasks-2.png)  
![\[The end tasks option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-lens-rules-ends-tasks-3.png)

1. Choose **Next**. Review and then choose **Save**.

1. After you add rules, they are applied to new contacts that occur after the rule was added. Rules are applied when Amazon Connect conversational analytics analyzes conversations.

   You cannot apply rules to past, stored conversations. 