Answers.Body: <p>I will add to this as I explore, but first up my findings. </p>
  
  <p>There is an 'event' for </p>
  
  <ul>
  <li>membership is added</li>
  <li>membership is changed</li>
  </ul>
  
  <p>There is an 'action' for "add to group" which allows adding to single or multiple groups.</p>
  
  <p>AFAIK there is no Condition yet for
   - Membership type
   - membership status change</p>
  
  <p>Also checked out if I could make the Rule based on the Activity that is generated when someone Expires eg 
   - Activity Type = Change Membership Status
   - Activity Subject = Status changed from Grace to Expired</p>
  
  <p>While the former exists, the latter doesn't so I can't see that I can currently build the Rule off that.</p>
  
  <p>So either way looks like we need to add some new Conditions. Will update on progress</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T04:57:24.450Z
Answers.Text: There should be a generic condition called field value comparison. I haven't tried that for membership, but I am using that for contribution status, which should be similar. So, if 'field value comparison' is available for a 'event' of the membership entity, then select membership status field, and select value
Answers.UserDisplayName: Flying
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T08:32:35.003Z
Answers.Text: Great hint thank you. While membership status is on the list, it comes with a warning "Error The field 'id' has no associated option list." and while the dropdown shows the names of the status, saving and reopening suggests it isn't quite working as it keeps reverting to "New'. Will dig more
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-13T09:40:17.727Z
Answers.Text: Any progress Pete? Happy to create a membership type and membership status condition at the sprint after London CiviCon (but perhaps you guys are already doing just that)?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-13T15:52:46.730Z
Answers.Text: I have just added the Membership Type and Membership Status conditions to the latest version of CiviRules.
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-13T17:56:58.107Z
Answers.Text: Look forward to giving it a try. Many thanks.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T21:01:36.780Z
Answers.Text: This looks to work really well. Thank you
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-04T21:27:38.497Z
Answers.LastActivityDate: 2015-10-04T21:27:38.497Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>Yes Pete, we have not worked on any conditions for membership status. We never had (and never will :-)) have the ambition of creating all sorts of Conditions. We have created the engine and the conditions/actions that our projects need. However, the engine allows you to create your own conditions and actions quite easily, that is documented on our wiki: <a href="http://redmine.civicoop.org/projects/civirules/wiki" rel="nofollow">http://redmine.civicoop.org/projects/civirules/wiki</a></p>
  
  <p>Documentation pages on creating conditions:
  <a href="http://redmine.civicoop.org/projects/civirules/wiki/Tutorial_create_a_new_and_simple_condition" rel="nofollow">http://redmine.civicoop.org/projects/civirules/wiki/Tutorial_create_a_new_and_simple_condition</a>
  <a href="http://redmine.civicoop.org/projects/civirules/wiki/Tutorial_create_a_more_complicated_condition_with_its_own_form_processing" rel="nofollow">http://redmine.civicoop.org/projects/civirules/wiki/Tutorial_create_a_more_complicated_condition_with_its_own_form_processing</a>
  It should be a pretty easy job to add a condition for membership type or membership status.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-02T06:56:08.997Z
Answers.Text: The linked sites are not available any more, but documentation about custom conditions can be found here: https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/
Answers.UserDisplayName: Philipp Michael
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T08:15:51.517Z
Answers.Text: looking forward to exploring it ;-)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T08:35:11.733Z
Answers.Text: Actually i got a hint here http://civicrm.stackexchange.com/questions/6835/does-civirules-add-remove-a-contact-to-a-group-based-on-membership-starting-expi/6836 that the " field value comparison" might suffice. And indeed it does offer me Membership Status, but also a warning "Error. The field 'id' has no associated option list." Will see if fixing that is enough.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T08:47:56.883Z
Answers.Text: Yes, that should work. But I guess it would be really good if there was a condition 'membership status' and type as I reckon there will be other potential users that might be a little less savvy?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-05T06:32:56.147Z
Answers.LastActivityDate: 2015-10-05T06:32:56.147Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Haven't used CiviRules before and I see it is only listed as working on 4.4 - but I want to see if on 4.6 can it </p>
  
  <ul>
  <li>add a contact to a Group when they purchase a new Membership, </li>
  <li>remove them from a Group when their Membership expires</li>
  <li>act on only specified Membership types</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-05T06:29:42.340Z
Comments.Text: Is the triggering 'event' membership added, or rather contribution added (of the financial type membership)? This could give two very different routes to solution
Comments.UserDisplayName: Flying
Tags: <civirules>
Title: Does CiviRules add/remove a contact to a Group based on Membership starting/expiring
ThreadText: # Does CiviRules add/remove a contact to a Group based on Membership starting/expiring
  
  (Asked by: username_0 on 2015-10-04)
  
  Haven't used CiviRules before and I see it is only listed as working on 4.4 - but I want to see if on 4.6 can it
  
  * add a contact to a Group when they purchase a new Membership,
  * remove them from a Group when their Membership expires
  * act on only specified Membership types
  
  **Tags:** civirules
  
  > **Comments:**
  > **username_1**: Is the triggering 'event' membership added, or rather contribution added (of the financial type membership)? This could give two very different routes to solution  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-10-05. Score: 3 | Accepted answer
  
  Yes Pete, we have not worked on any conditions for membership status. We never had (and never will :-)) have the ambition of creating all sorts of Conditions. We have created the engine and the conditions/actions that our projects need. However, the engine allows you to create your own conditions and actions quite easily, that is documented on our wiki: <http://redmine.username_2.org/projects/civirules/wiki>
  
  Documentation pages on creating conditions:
  <http://redmine.username_2.org/projects/civirules/wiki/Tutorial_create_a_new_and_simple_condition>
  <http://redmine.username_2.org/projects/civirules/wiki/Tutorial_create_a_more_complicated_condition_with_its_own_form_processing>
  It should be a pretty easy job to add a condition for membership type or membership status.
  
  > **Comments:**
  > **username_0**: looking forward to exploring it ;-)  
  > **username_0**: Actually i got a hint here http://civicrm.stackexchange.com/questions/6835/does-civirules-add-remove-a-contact-to-a-group-based-on-membership-starting-expi/6836 that the " field value comparison" might suffice. And indeed it does offer me Membership Status, but also a warning "Error. The field 'id' has no associated option list." Will see if fixing that is enough.  
  > **username_2**: Yes, that should work. But I guess it would be really good if there was a condition 'membership status' and type as I reckon there will be other potential users that might be a little less savvy?  
  > **username_3**: The linked sites are not available any more, but documentation about custom conditions can be found here: https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/  
  
  ---
  
  ### Answer by username_0 on 2015-10-04. Score: 2
  
  I will add to this as I explore, but first up my findings.
  
  There is an 'event' for
  
  * membership is added
  * membership is changed
  
  There is an 'action' for "add to group" which allows adding to single or multiple groups.
  
  AFAIK there is no Condition yet for
  - Membership type
  - membership status change
  
  Also checked out if I could make the Rule based on the Activity that is generated when someone Expires eg
  - Activity Type = Change Membership Status
  - Activity Subject = Status changed from Grace to Expired
  
  While the former exists, the latter doesn't so I can't see that I can currently build the Rule off that.
  
  So either way looks like we need to add some new Conditions. Will update on progress
  
  > **Comments:**
  > **username_1**: There should be a generic condition called field value comparison. I haven't tried that for membership, but I am using that for contribution status, which should be similar. So, if 'field value comparison' is available for a 'event' of the membership entity, then select membership status field, and select value  
  > **username_0**: Great hint thank you. While membership status is on the list, it comes with a warning "Error The field 'id' has no associated option list." and while the dropdown shows the names of the status, saving and reopening suggests it isn't quite working as it keeps reverting to "New'. Will dig more  
  > **username_2**: Any progress Pete? Happy to create a membership type and membership status condition at the sprint after London CiviCon (but perhaps you guys are already doing just that)?  
  > **username_2**: I have just added the Membership Type and Membership Status conditions to the latest version of CiviRules.  
  > **username_0**: Look forward to giving it a try. Many thanks.  
  > **username_0**: This looks to work really well. Thank you  
  
  ---
  
  