SHARE
TWEET

Untitled

a guest Jun 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. parser = argparse.ArgumentParser()
  2. parser.add_argument("-u", "--username", action="store", type=str)
  3. parser.add_argument("-p", "--password", action="store", type=str)
  4.  
  5.  
  6. args =  parser.parse_args(sys.argv[1:])
  7. x = args.username
  8. y = args.password
  9.  
  10.  
  11. def getrevisiondata():
  12.    
  13.     url2 = "https://rally1.rallydev.com/slm/webservice/v2.0/defect?query=((c_CAGFieldDefect = true) AND (State != Closed))&fetch=FormattedID,RevisionHistory,CreationDate,LastUpdateDate,c_CAGCategory&start=1&pagesize=500"
  14.     r = requests.get(url2, auth=(x, y))
  15.     return r
  16.  
  17.  
  18.  
  19. def gettotalID():
  20.     r = getrevisiondata()
  21.     parsed = r.json()
  22.  
  23.     totalcount = int(parsed["QueryResult"]["TotalResultCount"])
  24.     maxval = totalcount -1
  25.  
  26.     y = -1
  27.     while y <= maxval:
  28.         y += 1
  29.         if y <= maxval:
  30.             IDlist.append(parsed["QueryResult"]["Results"][y]['FormattedID'])
  31.         else:
  32.             return IDlist
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top