-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCreateTicket.ahk
65 lines (55 loc) · 1.73 KB
/
CreateTicket.ahk
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
; Creates an IT HPSM Ticket from a ConNext Forum Entry
; Forum Entry must be opened in current active browser
; See documentation
; Relies on ConNext2HPSM.ini in %A_ScriptDir%
; Calls: GetActiveBrowserUrl
; Does not require setting up Password
#Include <WinactiveBrowser>
#NoTrayIcon
#SingleInstance force ; for running from editor - avoid warning if another instance is running
; Ctrl+Win+T
^#t:: ; <--- [Browser] Create Ticket
; Constants
sTel = 7428
sForumUrl := GetActiveBrowserUrl()
;sForumTitle := ConNextGetForumTitle(sForumUrl)
WinGetActiveTitle, sForumTitle
; Remove trailing - containing program e.g. - Google Chrome
StringGetPos,pos,sForumTitle,%A_space%-,R
if (pos != -1)
sForumTitle := SubStr(sForumTitle,1,pos)
sDesc := RegExReplace(sForumTitle," - .*","")
; Extract Category from Forum Title
If RegExMatch(sForumTitle,"- (.*) Forum -",sForumShortTitle) {
sIniFile = %A_ScriptDir%\ConNext2HPSMCat.ini
needle := sForumShortTitle1 "\t(.*)"
Loop, Read, %sIniFile%
{
If RegExMatch(A_LoopReadLine, needle, sCat) {
sCat := sCat1
Break
}
}
}
If !sCat
sCat = %sForumShortTitle1%
If sCat = ConNext
sDetails = See details %sForumUrl%. Please root directly to ConNext Support who has access to this page.
Else {
sDetails = See attached PDF for details. (Source %sForumUrl%)
Send ^P ; Print
}
Run https://hpsm-web.cw01.contiwan.com/sm/ess.do
MsgBox 0x1001, Wait..., Wait for Submit a Trouble Ticket. Click on the Ticket Form 'Preferred Phone number'. Press OK when ready to be filled.
IfMsgBox Cancel
return
SendInput {Raw} %sTel%
Send {Tab}
SendInput {Raw} %sCat%
Send {Tab 3}
SendInput {Raw} %A_ComputerName%
Send {Tab 2}
SendInput {Raw} %sDesc%
Send {Tab}
SendInput {Raw} %sDetails%
return