Пример #1
0
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',
Пример #2
0
 def getConnect(self):
     at=atws.connect(username=self.name,password=self.pwd)
     return at
Пример #3
0
 def getConnect(self, name='',pwd=''):
     conn=atws.connect(username=name,password=pwd)
     
     return conn
Пример #4
0
 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) 
Пример #5
0
 def __init__(self):
     """Init fall"""
     self.at = atws.connect(username=config.autoTaskCredentials['username'],
                            password=config.autoTaskCredentials['password'])
Пример #6
0
 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)
Пример #7
0
def getConnect():

    at = atws.connect(username='', password='')
    return at
Пример #8
0
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