import atws import atws.monkeypatch.attributes from slackbot.bot import respond_to from slackbot.bot import listen_to import re import json at = atws.connect(username='******',password='******') @respond_to('(T\d{8}\.\d{4}) assign ([A-Z][a-zA-Z]*) ([A-Z][a-zA-Z]*)') def assignticket(message, ticket_number, first_name, last_name): query = atws.Query('Ticket') query.WHERE('TicketNumber',query.Equals,ticket_number) ticketnumberquery = at.query(query).fetch_one() query = atws.Query('Resource') query.WHERE('FirstName',query.Equals,first_name) query.WHERE('LastName',query.Equals,last_name) personquery = at.query(query).fetch_one() ticketnumberquery.AssignedResourceID = f'{personquery.id}' ticketnumberquery.AssignedResourceRoleID = '29683465' ticketnumberquery.update() attatchments = [{ 'fallback': 'Ticket Assigned', 'author_name': 'Ticket Assigned',
def getConnect(self): at=atws.connect(username=self.name,password=self.pwd) return at
def getConnect(self, name='',pwd=''): conn=atws.connect(username=name,password=pwd) return conn
def test_000_zone_lookup_failure(self): try: _ = atws.connect(username='******', password='******') except ValueError as e: assert '[email protected] failed to resolve to a zone' in str(e)
def __init__(self): """Init fall""" self.at = atws.connect(username=config.autoTaskCredentials['username'], password=config.autoTaskCredentials['password'])
def getConnect(): at = atws.connect(username='', password='') return at
import atws user = raw_input("Username:"******"Password:") at = atws.connect(username=user, password=pass, support_file_path='C:\ATWS\TEMP') query = atws.Query('Ticket') query.WHERE('id',query.GreaterThan,5667) testing sdfg