Re: [rt-users] Need help getting REST API calls to work using WinHttpRequest from VBA
Hi, you will probably find what you need by looking at the source code of my RTChecker project. Look here: https://www.assembla.com/spaces/rtcheckerv2 Hope this helps Cris On 05/01/2015 04:39 PM, Tim Elkin wrote: Our goal is to create a Ticket in RT using VBA using the WinHttpRequest object. We understand that there are 2 login pages involved with RT. So, first we log into the first RT login page using using a POST request and passing the username and password using the SetCredentials function of the WinHttpRequest object. This request appears to return a valid session cookie which we parse to use in our second WinHttpRequest request. In making our second request we use a GET request setting the 2nd RT login username and password using the SetCredentials function and in addition we now are passing the session cookie (that is we send a portion of the session cookie returned from the previous request) info using the SetRequestHeader (as in SetRequestHeader Cookie, mvarSessionCookie ). In this second request we are asking for an RT Ticket to be returned using https://(our url)/REST/1.0/ticket/(a ticket #)/showhttps://(oururl)/REST/1.0/ticket/(aticket#)/show. However, we receive the 401 Authorization error instead. Some sample code would be great. Below is the code we are using presently to verify that the session cookie we receive from the 1st RT login page is valid by using a second request to return an existing RT ticket (which is hard coded for testing purposes): Private Const cnstBase_URL As String = https://[our RT url] With WinHttpReq 'either of the following lines seems to work and return a cookie .Open POST, cnstBase_URL .SetRequestHeader User-Agent, Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 .SetRequestHeader Connection, keep-alive 'user name and password for 1st RT login page/url .SetCredentials cnstRequestor, cnstPWD, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER On Error Resume Next .Send If Err.Number = 0 Then If .Status = 200 Then On Error Resume Next output_Cookie = .getResponseHeader(Set-Cookie) On Error GoTo 0 myCookie = Split(output_Cookie, ;) If UBound(myCookie) 0 Then 'implicit conversion to string mvarSessionCookie = myCookie(0) End If Else Debug.Print HTTP .Status .StatusText End If Else Debug.Print Error Err.Number Err.Source Err.Description End If On Error GoTo 0 End With Set WinHttpReq = Nothing If Trim(mvarSessionCookie) = Then Exit Function 'perform second request Set WinHttpReq = New WinHttp.WinHttpRequest With WinHttpReq 'get ticket data Dim TargetURL As String 'to test cookie, display a ticket 'hard coded for testing as this works from the Browser which I thought would be a good test 'to see if the Cookie variable works TargetURL = https://[our RT url]/REST/1.0/ticket/96494/show .Open GET, TargetURL, False .SetRequestHeader User-Agent, Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 .SetRequestHeader Connection, keep-alive .SetRequestHeader Cookie, mvarSessionCookie 'user name and password for 2nd RT login page/url .SetCredentials cnstBasic_Auth_User, cnstBasic_Auth_PWD, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER On Error Resume Next .Send If Err.Number = 0 Then If .Status = 200 Then Debug.Print Debug.Print .ResponseText Debug.Print .GetAllResponseHeaders Else Debug.Print HTTP .Status .StatusText End If Else Debug.Print Error Err.Number Err.Source Err.Description End If On Error GoTo 0 Debug.Print .GetAllResponseHeaders End With Set WinHttpReq = Nothing Thanks, in advance, Tim
[rt-users] Freeze the requestor field
Hi everyone, On ticket creation I would like to freeze the requestor field to be set to the user's email, RT does it by the default but let the field modifiable by the user and they can put any mail address there so I would like to freeze that field. anyone have an idea how I can do that ? Thanks in advance,
Re: [rt-users] Freeze the requestor field
Hi, I think you should look at the rights granted in your queue. I guess that remove the right to modify ticket should help. To be sure about what to do and know the properties of each rights, I suggest you to read the documentation here : http://requesttracker.wikia.com/wiki/QueueSpecificRights Hope it helps you Regards, Loic Cadoret IT Technician Keyyo Le 04/05/2015 11:40, ABD EL MALEK BOUBARNOUS a écrit : Hi everyone, On ticket creation I would like to freeze the requestor field to be set to the user's email, RT does it by the default but let the field modifiable by the user and they can put any mail address there so I would like to freeze that field. anyone have an idea how I can do that ? Thanks in advance,
[rt-users] WikiText not decoded to HTML on Display
Hi all, just setup RT with Articles and CF type of wikitext. Unfortunately the value of this CF is not decoded to HTML and shown as is in DB. Example: Database entry: === General rules === Always create OS filesystem on separate disks. is shown without heading formatting and with all the '=' characters. Went through the documentation, but wasn't able to find anything which would help me to solve this issue. RT version: 4.2.10, Text::Wikiformat version 0.81 installed from CPAN. Is there anything I should check? Even debug logging doesn't show any issue. Thank you in advance. -- Peter
Re: [rt-users] charset troubles
On Fri, May 01, 2015 at 05:53:58PM +0200, Emmanuel Dreyfus wrote: PostgreSQL 9.4.1. And p5-DBD-postgresql-3.5.1 was missing in my list. I may be able to debug some of it, but I would need some hints: where is the attachment supposed to be converted into quited-printable? It happens through Ticket/Update.html but not through Ticket/Create.html The difference should not be that hard to spot. -- Emmanuel Dreyfus m...@netbsd.org
[rt-users] Queues, surveys for agents, and forms
I have not yet deployed RT, and am spending time studying it before I do so. There are many questions at this stage, but beyond what I have found in the docs: 1. Is there some documentation on how to set up multiple queues? Our university has several different offices that need separate queues, and while allusions are made to queues and associated lifecycles, I could not find much on how to set up independent queues in the first place. 2. We plan to use user surveys on each ticket to generate performance information on agents. Typically, each ticket will be handled by multiple agents. Is there a way for the customer to give different ratings to different agents? 3. How do I set up forms for common tasks? I realize that I need to go deeper into the documentation (and I have to a first pass, read all that is included the user manual for 4.2.10, so simply RTFM will not be a helpful response), but I find myself faced with these unaddressed questions. Please bear with a newbie here and feel free to point me to the right documentation. Thanks.
Re: [rt-users] Queues, surveys for agents, and forms
Hi Geico, 1. Is there some documentation on how to set up multiple queues? Our university has several different offices that need separate queues, and while allusions are made to queues and associated lifecycles, I could not find much on how to set up independent queues in the first place. I'm not sure to understand correctly your question. In RT, you can create multiple queue (I guess one by office) very easily. Each queue is independant (it has it own correspond address, admin, user rights, custom fields and scripts) and you can set them as you want to correspondant with what want to do. 2. We plan to use user surveys on each ticket to generate performance information on agents. Typically, each ticket will be handled by multiple agents. Is there a way for the customer to give different ratings to different agents? I don't think that this feature exists by default in Request Tracker, maybe an external plugin can do the job. A way to do it is to use Custom fields in your queue. For exemple, you create a custom field by agent with the rates that can be given as values of the custom field. Maybe someone else will give you a much better solution. 3. How do I set up forms for common tasks? Do you mean that you would like to create php form wich will create a ticket by submiting it ? If yes, then yes it is totaly possible. I think that it would be a very good idea to install Request Tracket on a test VM in order to test this solution and get more familiar with its functionalities. You can find RT doc here : https://www.bestpractical.com/docs/rt/4.2/ Hope it helped you, Regards, Loic Cadoret IT Technician Keyyo Le 04/05/2015 15:55, Geico Caveman a écrit : I have not yet deployed RT, and am spending time studying it before I do so. There are many questions at this stage, but beyond what I have found in the docs: 1. Is there some documentation on how to set up multiple queues? Our university has several different offices that need separate queues, and while allusions are made to queues and associated lifecycles, I could not find much on how to set up independent queues in the first place. 2. We plan to use user surveys on each ticket to generate performance information on agents. Typically, each ticket will be handled by multiple agents. Is there a way for the customer to give different ratings to different agents? 3. How do I set up forms for common tasks? I realize that I need to go deeper into the documentation (and I have to a first pass, read all that is included the user manual for 4.2.10, so simply RTFM will not be a helpful response), but I find myself faced with these unaddressed questions. Please bear with a newbie here and feel free to point me to the right documentation. Thanks.