[SOLVED] getting tickets with a certain queue, subject, and date range

Moderator: crythias

Locked
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

[SOLVED] getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

Hello,

I'm trying to write and enable an invoker that I can use to return tickets in a certain queue, with a certain subject line, and in a certain date range. I've been trying make sense of constructing this by reviewing OTRS's native Ticket::TicketGet invoker and was hoping for advice.

I also don't have the option to add an invoker to my web service that I generated through OTRS's Admin panel. Do I need different permissions to do this? Do I need access to our OTRS instance's file system to manually copy over the invoker?
You do not have the required permissions to view the files attached to this post.
Last edited by ATD39401 on 02 Aug 2024, 17:27, edited 2 times in total.
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

Hi,

The version you're using has no invoker. I recommend updating to Znuny LTS 6.5, a version that comes with the function you want.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

Thanks for the help! Unfortunately updating OTRS versions will not be possible at this time. Is there any way to load the interface I made in Perl manually or modify anything where OTRS is hosted so what I wrote with PyOTRS will hit it and return what I need?
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

ATD39401 wrote: 19 Jul 2024, 23:03 Thanks for the help! Unfortunately updating OTRS versions will not be possible at this time. Is there any way to load the interface I made in Perl manually or modify anything where OTRS is hosted so what I wrote with PyOTRS will hit it and return what I need?
HI,

When you want to use PyOTRS then you need a provider in the web service, not an invoker. Regular ticket operations are part of your version.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

I thought I had already set that up. Attached are screenshots showing what my REST provider settings currently look like.
You do not have the required permissions to view the files attached to this post.
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

Hi,

There are two unknown controller and their route mapping is .. let's say interesting. From where do you get them?
Just use the ticket search operation with parameters.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

To confirm, calling on the TicketSearch operation attached with the following parameters should return what I want, correct?

Code: Select all

https://[SITE]/otrs/nph-genericinterface.pl/Webservice/ConvCopier/Ticket/TicketSearch/:TicketID?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=%27Meter Readings Due%27?
You do not have the required permissions to view the files attached to this post.
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

ATD39401 wrote: 23 Jul 2024, 16:03 To confirm, calling on the TicketSearch operation attached with the following parameters should return what I want, correct?

Code: Select all

https://[SITE]/otrs/nph-genericinterface.pl/Webservice/ConvCopier/Ticket/TicketSearch/:TicketID?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=%27Meter Readings Due%27?
Hi,

I do not know your Method for the ticket search operation. The :TicketID does not belong into the URL it's a placeholder. How does your Network properties look for this operation?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

I am currently trying to test this query using curl and adding header formatting as shown below.

Code: Select all

curl -v -H "Accept: application/json" "https://[SITE]/otrs/nph-genericinterface.pl/Webservice/ConvCopier/Ticket/TicketSearch?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=%27Meter Readings Due%27"
As for "network properties", do you mean how I format the header or the method through which I'm trying to make the API call?
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

Hi,

This call looks good, except the crdentials are missing - do not post them here ;-)
What is the result for this request?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

Yes, the credentials have been purposefully omitted. When I try this I get an error from curl saying that the URL is not formatted correctly, listed below.

Code: Select all

* URL rejected: Malformed input to a URL function
* Closing connection
curl: (3) URL rejected: Malformed input to a URL function
root
Administrator
Posts: 4249
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by root »

Hi,

Please export the webservice and upload it here.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

Sure, thank you Roy! Here's the current version.

EDIT: I generated a new web service to test but forgot some things so I made appropriate changes. Attached is the associated YAML file.
You do not have the required permissions to view the files attached to this post.
ATD39401
Znuny newbie
Posts: 21
Joined: 28 Jun 2024, 14:38
Znuny Version: 6.0.44
Real Name: Amber Denton
Company: UTK College of Veterinary Medicine

Re: invoker for getting tickets with a certain queue, subject, and date range

Post by ATD39401 »

Quick addendum after re-reading the documentation: should my route for hitting the tickets I want be called as shown below?

Code: Select all

[HOST]/ConvCopierReports/TicketSearch?QueueID=27&TicketCreateTimeNewerMinutes=43200&Title=%27Meter+Readings+Due%27?[CREDENTIALS]
EDIT: long story short I should have encoded the spaces in the "Title" parameter appropriately for the URL. I admittedly got flustered and didn't even notice. I'm pulling the ticket IDs I need after making that change. Thanks everyone!
Locked