Wiki

Case Status Kiln
Register Log In

Wiki

 
Unsubscribe Me
  • RSS Feed

Last modified on 1/23/2012 1:27 PM by User.

Tags:

Unsubscribe Me

unsubscribeMe.py

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
"""
Unsubscribe Me

This script will unsubscribe me from all cases for
which I am currently subscribed. The user being 
unsubscribed is the one who corresponds to the 
authentication TOKEN.

How to use this script:
1. Set up the appropriate fbSettings.py (see 
   https://developers.fogbugz.com/default.asp?W198
   for more details) for the user for who you want
   to unsubscribe.
2. Run the script from the command line using:
   > python unsubscribeMe.py

See https://developers.fogbugz.com/default.asp?W194 for more
information on using the FogBugz XML API with Python.
"""

from fogbugz import FogBugz
import fbSettings

fb = FogBugz(fbSettings.URL, fbSettings.TOKEN)

resp = fb.search(q='show:subscribed',cols='ixBug')

for case in resp.cases.childGenerator():
  ixBug = case.ixbug.string
  fb.unsubscribe(ixBug=ixBug)