Sign in to follow this  
Followers 0
rosaz

BMC Remedy

8 posts in this topic

Hello,

Does anyone have experience using AutoIt with BMC Remedy? Specifically, I'm trying to find the best way to navigate around Remedy, as using Send ("{Tab}") has provided unreliable. Is there a better way? I was trying to use ControlSend, but wasn't able to get handles for the controls. Thanks in advance for any suggestions!

Share this post


Link to post
Share on other sites



Hi rosaz, welcome to the forum. I use Remedy ver 6 here at work, I have some experience working with it, mostly working with the com interface (which is a little crappy). Anyway, what are you trying to do specifically? I haven't done much with navigating through remedy with Controlxxx but you can browse tickets, and retrieve pretty much any information you want with the com method (using Remedy.User.1).

I'm not 100% sure about it, as I don't know my way around dlls, but I believe there is a dll that will allow you to work directly with the AR server and totally bypass remedy, but that may be overkill for what you want.

I can post some scripts and send you some .pdfs I have if you want.


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

Hi someone- I'm trying to enter information into Remedy from an Excel spreadsheet. I would be very grateful for any scripts you could post/ send me (rosaz2828@aol.com). Also, sorry to ask stupid questions, but what is the com method and how would I use it? :)

Share this post


Link to post
Share on other sites

This seems to be one of those things that should be easy but isn't.... its pretty easy to get info out of remedy but apparently not write in to it... hmm. I'll keep working on though.

This it the code I'm using for access an entry in Remedy via COM;

Global $g_eventerror = 0    ; to be checked to know if com error occurs. Must be reset after handling.
Global $oRemedy
Global $iSession = 0

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler

$oRemedy = ObjGet("", "Remedy.User.1") ;assuming you have Remedy running

$iTicket = "9118838" ;whatever ticket/entry #
$iTicket_Full = "00000000" & $iTicket

$oRemedyForm = $oRemedy.LoadForm($iSession, "server", "formname", $iTicket_Full, 4, True)
$oWorkLog = $oRemedyForm.GetField("Short Description")
MsgBox(0, "Value", $oWorkLog.Value())


;$oRemedyForm.Modify()




Func MyErrFunc()

  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
             "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
             "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
            )
            
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

That code will open up that entry ID and retrieve text from the 'short description' field the form I'm using has. Try playing around with using this method and then controlsend/settext for what you need, and see how it works for you. I'll keep looking, seems there has to be an easy way to write to a field.


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

EDIT - I realize this post is old but it came up again where someone was trying to edit fields in Remedy. Since posting this I've found you CAN modify fields through the COM by basically doing a $oObject.Value = "new value" line.

I just sent you an email with a pdf of Remedy COM information. I would have prefered to post it here but I cant' get it small enough to post. I am sorta purposly avoiding explaining COM as I'm fairly new to it but essentially its a way of communicating between programs. The help file is good and has a lot of COM stuff in it.

Anyway, I played around more with Remedy, I dont think they give you anyway of modifying fields using COM, but only through the API(which I mentioned before, but I have no idea how to do stuff like that).

I dont know how to access the web front end like Jos mentioned. I have a feeling that isn't enable where I work, but if you can get to yours it might be the best way to go, but it could be slow. Below is about the best I can think of; essentially I can use the COM method to load an entry ID, and give it focus. From there, I am using ControlSetText with good success. Very similar to my last code posting.

Global $g_eventerror = 0    ; to be checked to know if com error occurs. Must be reset after handling.
Global $oRemedy
Global $iSession = 0

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler

$oRemedy = ObjGet("", "Remedy.User.1")

$iTicket = "9112957" ;whatever ticket/entry #
$iTicket_Full = "00000000" & $iTicket

$oRemedyForm = $oRemedy.LoadForm($iSession, "server", "formname", $iTicket_Full, 4, True)
$oWorkLog = $oRemedyForm.GetField("Short Description")
;MsgBox(0, "Value", $oWorkLog.Value())


$oShortDescription = $oRemedyForm.GiveFieldFocus("Short Description")
ControlSetText("Remedy", "", 32768, "new text")

;$oRemedyForm.Modify() ;use this to save your changes

Func MyErrFunc()

  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
             "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
             "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
            )
            
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

Let me know how you make out.

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

Someone-

That worked great. Thank you!

Share this post


Link to post
Share on other sites

Someone-

Would you be able to send it to my mailbox as well pls?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0