Applying filters if they're missing

91 views
Skip to first unread message

Ashley Attwood

unread,
Nov 8, 2017, 6:23:13 AM11/8/17
to GAM for G Suite
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?

Andy Poirier

unread,
Nov 8, 2017, 10:11:33 AM11/8/17
to google-ap...@googlegroups.com
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/4771772a-4989-4adf-93eb-58a65c964807%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ashley Attwood

unread,
Nov 8, 2017, 3:55:11 PM11/8/17
to GAM for G Suite
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.

Ross Scroggs

unread,
Nov 8, 2017, 4:09:01 PM11/8/17
to google-ap...@googlegroups.com
Ashley,

Show me the exact command you're issuing, change the email address if you need to, but otherwise send exact command.

Ross

On Wed, Nov 8, 2017 at 12:55 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ashley Attwood

unread,
Nov 8, 2017, 4:24:13 PM11/8/17
to GAM for G Suite
Here's the final command I'm trying to use.

gam group groupemail@domain.com filter query "list:othergr...@domain.com" label "Invoices" archive markread


So the filter identifies and archives any messages received from a specific group. I've also tested with single user targeting as well:

gam user em...@domain.com filter query "list:othergr...@domain.com" label "Invoices" archive markread




On Wednesday, 8 November 2017 21:09:01 UTC, Ross Scroggs wrote:
Ashley,

Show me the exact command you're issuing, change the email address if you need to, but otherwise send exact command.

Ross
On Wed, Nov 8, 2017 at 12:55 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Nov 8, 2017, 5:19:42 PM11/8/17
to google-ap...@googlegroups.com
Ashley,

Its the markread that causes trouble.

$ gam user testuser1 add filter query "list:testg...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw, Added (1/1)

$ gam user testuser1 add filter query "list:testg...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)


ERROR: 400: Filter already exists - failedPrecondition


$ gam user testuser1 add filter query "list:testg...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA, Added (1/1)

$ gam user testuser1 add filter query "list:testg...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg, Added (1/1)


$ gam user testuser1 show filters

Usertest...@domain.com, Filters: (1/1)

  Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg (1/3)

    Criteria:

      query "list:testg...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA (2/3)

    Criteria:

      query "list:testg...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw (3/3)

    Criteria:

      query "list:testg...@domain.com"

    Actions:

      label "Invoices"

      archive

$


Its not a Gam problem, I get the same results in the developer's console.

Talk to Google,

Ross

On Wed, Nov 8, 2017 at 1:24 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
Here's the final command I'm trying to use.

gam group groupemail@domain.com filter query "list:othergroupemai@domain.com" label "Invoices" archive markread


So the filter identifies and archives any messages received from a specific group. I've also tested with single user targeting as well:

gam user em...@domain.com filter query "list:othergroupemai@domain.com" label "Invoices" archive markread




On Wednesday, 8 November 2017 21:09:01 UTC, Ross Scroggs wrote:
Ashley,

Show me the exact command you're issuing, change the email address if you need to, but otherwise send exact command.

Ross
On Wed, Nov 8, 2017 at 12:55 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Nov 8, 2017, 5:26:38 PM11/8/17
to google-ap...@googlegroups.com
Ashley,

It's more subtle than I thought; it's the order "archive marked". Put archive last and it works as expected.

Ross

On Wed, Nov 8, 2017 at 2:19 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Ashley,

Its the markread that causes trouble.

$ gam user testuser1 add filter query "list:testgroup2@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw, Added (1/1)

$ gam user testuser1 add filter query "list:testgroup2@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)


ERROR: 400: Filter already exists - failedPrecondition


$ gam user testuser1 add filter query "list:testgroup2@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA, Added (1/1)

$ gam user testuser1 add filter query "list:testgroup2@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg, Added (1/1)


$ gam user testuser1 show filters

Usertest...@domain.com, Filters: (1/1)

  Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg (1/3)

    Criteria:

      query "list:testgroup2@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA (2/3)

    Criteria:

      query "list:testgroup2@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw (3/3)

    Criteria:

      query "list:testgroup2@domain.com"

To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--



--

Ross Scroggs

unread,
Nov 8, 2017, 6:06:19 PM11/8/17
to google-ap...@googlegroups.com
Ashley,

Into the dark and mysterious we go; to avoid duplicates:
These options should appear in this order: markread notimportant archive never spam
These options should appear in this order: important star trash

In this order the duplicates are caught.

Ross
--

Ashley Attwood

unread,
Nov 9, 2017, 2:08:38 PM11/9/17
to GAM for G Suite
brilliant. Thanks. 
That's my own fault as the wiki has them in the correct order as well.


On Wednesday, 8 November 2017 23:06:19 UTC, Ross Scroggs wrote:
Ashley,

Into the dark and mysterious we go; to avoid duplicates:
These options should appear in this order: markread notimportant archive never spam
These options should appear in this order: important star trash

In this order the duplicates are caught.

Ross
On Wed, Nov 8, 2017 at 2:26 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Ashley,

It's more subtle than I thought; it's the order "archive marked". Put archive last and it works as expected.

Ross
On Wed, Nov 8, 2017 at 2:19 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Ashley,

Its the markread that causes trouble.

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw, Added (1/1)

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)


ERROR: 400: Filter already exists - failedPrecondition


$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA, Added (1/1)

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg, Added (1/1)


$ gam user testuser1 show filters

Usertest...@domain.com, Filters: (1/1)

  Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg (1/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA (2/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw (3/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      archive

$


Its not a Gam problem, I get the same results in the developer's console.

Talk to Google,

Ross
On Wed, Nov 8, 2017 at 1:24 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
Here's the final command I'm trying to use.

gam group groupemail@domain.com filter query "list:othe...@domain.com" label "Invoices" archive markread


So the filter identifies and archives any messages received from a specific group. I've also tested with single user targeting as well:

gam user em...@domain.com filter query "list:othe...@domain.com" label "Invoices" archive markread




On Wednesday, 8 November 2017 21:09:01 UTC, Ross Scroggs wrote:
Ashley,

Show me the exact command you're issuing, change the email address if you need to, but otherwise send exact command.

Ross
On Wed, Nov 8, 2017 at 12:55 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--



--



--

Ashley Attwood

unread,
Nov 9, 2017, 2:08:56 PM11/9/17
to GAM for G Suite
brilliant. Thanks. 
That's my own fault as the wiki has them in the correct order as well.

On Wednesday, 8 November 2017 23:06:19 UTC, Ross Scroggs wrote:
Ashley,

Into the dark and mysterious we go; to avoid duplicates:
These options should appear in this order: markread notimportant archive never spam
These options should appear in this order: important star trash

In this order the duplicates are caught.

Ross
On Wed, Nov 8, 2017 at 2:26 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Ashley,

It's more subtle than I thought; it's the order "archive marked". Put archive last and it works as expected.

Ross
On Wed, Nov 8, 2017 at 2:19 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Ashley,

Its the markread that causes trouble.

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw, Added (1/1)

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive

Adding filter for test...@domain.com (1/1)


ERROR: 400: Filter already exists - failedPrecondition


$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA, Added (1/1)

$ gam user testuser1 add filter query "list:te...@domain.com" label "Invoices" archive markread

Adding filter for test...@domain.com (1/1)

Usertest...@domain.com, Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg, Added (1/1)


$ gam user testuser1 show filters

Usertest...@domain.com, Filters: (1/1)

  Filter: ANe1BmiZ3WMBerP8KeioqQw1G5AQ5c9mDnU6Wg (1/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmgRWBp5RJR0yjenp5rVTE_qzfa5HihHtA (2/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      markread

      archive

  Filter: ANe1BmhFajJPoEss4v3mEdgobi-zzxIwrLzTqw (3/3)

    Criteria:

      query "list:te...@domain.com"

    Actions:

      label "Invoices"

      archive

$


Its not a Gam problem, I get the same results in the developer's console.

Talk to Google,

Ross
On Wed, Nov 8, 2017 at 1:24 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
Here's the final command I'm trying to use.

gam group groupemail@domain.com filter query "list:othe...@domain.com" label "Invoices" archive markread


So the filter identifies and archives any messages received from a specific group. I've also tested with single user targeting as well:

gam user em...@domain.com filter query "list:othe...@domain.com" label "Invoices" archive markread




On Wednesday, 8 November 2017 21:09:01 UTC, Ross Scroggs wrote:
Ashley,

Show me the exact command you're issuing, change the email address if you need to, but otherwise send exact command.

Ross
On Wed, Nov 8, 2017 at 12:55 PM, Ashley Attwood <ashley....@aztecuk.com> wrote:
See, that's what I would expect to happen. But if I run the same "gam user filter...." command 5 times I end up with 5 identical filters in my account. The only difference is the unique string that indexes them. It's the same if I use "gam group filter..." as well.
Gam 4.32 if it makes any difference for anyone.


On Wednesday, 8 November 2017 15:11:33 UTC, Andy Poirier wrote:
If I try to add the same filter twice, i get this error 

ERROR: 400: Filter already exists - failedPrecondition


Andy Poirier

Sr. IT Engineer


W E D D I N G W I R E


301 231 9473

an...@weddingwire.com

websitefacebookinstagramlinkedin



On Wed, Nov 8, 2017 at 6:23 AM, Ashley Attwood <ashley....@aztecuk.com> wrote:
I'm trying to ensure that a set of users always have a particular set of filters setup in their inbox. I can push the filters out to the group using GAM, but if that user already has the filter then it creates a duplicate every time the script is run. Is it possible to check the filter against existing ones and only add it if it's not there?





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--





This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--



--



--
Reply all
Reply to author
Forward
0 new messages