Create PostMaster Filter via API
Moderator: crythias
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Create PostMaster Filter via API
Hello,
I am using the OTRS SOAP API to create users and tickets. I do also need to create PostMaster Filters via API, but it does not seem to work. Does anyone know how to do this, or at least if this can be done via API at all?
Thank you very much!
regards, Tom
I am using the OTRS SOAP API to create users and tickets. I do also need to create PostMaster Filters via API, but it does not seem to work. Does anyone know how to do this, or at least if this can be done via API at all?
Thank you very much!
regards, Tom
Re: Create PostMaster Filter via API
I assume you use the "old" rpc.pl API. So you have to add the needed Backend modules in the code.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Re: Create PostMaster Filter via API
Hello,
thank you for your answer!
Is there another API that I should know about?
Regards, Tom
thank you for your answer!
I am not sure what you mean. I was following the OTRS 4.0 API Reference, found here: http://otrs.github.io/doc/api/otrs/stable/index.htmlI assume you use the "old" rpc.pl API
Is there another API that I should know about?
Do you know where I can find examples for that?So you have to add the needed Backend modules in the code.
Regards, Tom
Re: Create PostMaster Filter via API
ok, you are using direct API access...
Did you checked http://otrs.github.io/doc/api/otrs/stab ... er.pm.html
Did you checked http://otrs.github.io/doc/api/otrs/stab ... er.pm.html
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Re: Create PostMaster Filter via API
Hi,
yes I did. And, as I said, whith the info provided here I was able to use the ticker and customerUser objects so far. But the filters will not work.
Basically, I followed an example I found here at the forum: viewtopic.php?t=2945
If you take the example of creating a ticket:
Perhaps there is something I have to know about the object name; in tickets, it is Kernel::System::Ticket, in Filters it is Kernel::System::PostMaster::Filter. So maybe I have to use somthing else than "PMFilterObject" for module name, like "PostMaster::Filter".
yes I did. And, as I said, whith the info provided here I was able to use the ticker and customerUser objects so far. But the filters will not work.
Basically, I followed an example I found here at the forum: viewtopic.php?t=2945
If you take the example of creating a ticket:
For example I changed "TicketObject" and "TicketCreate" to "PMFilterObject" and "FilterList" and used an empty array for parameters. Then I get the response message 'No such Object PMFilterObject!'.Code: Select all
$ticket = $client->__soapCall("Dispatch", array("user", "passwort", "TicketObject", "TicketCreate", ...
Perhaps there is something I have to know about the object name; in tickets, it is Kernel::System::Ticket, in Filters it is Kernel::System::PostMaster::Filter. So maybe I have to use somthing else than "PMFilterObject" for module name, like "PostMaster::Filter".
Last edited by rootuser on 26 Feb 2015, 16:30, edited 1 time in total.
Re: Create PostMaster Filter via API
well, htne you have to digg in the code...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Re: Create PostMaster Filter via API
Hello,
after browsing the file /opt/otrs/bin/cgi-bin/rpc.pl, which is the API entry point script, I found the following code lines:
I hope that some of you can use this piece of information!
Regards, Tom
after browsing the file /opt/otrs/bin/cgi-bin/rpc.pl, which is the API entry point script, I found the following code lines:
Obviously, postmaster or filter is missing. So I simply added:Code: Select all
$CommonObject{ConfigObject} = $Kernel::OM->Get('Kernel::Config'); $CommonObject{CustomerCompanyObject} = $Kernel::OM->Get('Kernel::System::CustomerCompany'); $CommonObject{CustomerUserObject} = $Kernel::OM->Get('Kernel::System::CustomerUser'); $CommonObject{EncodeObject} = $Kernel::OM->Get('Kernel::System::Encode'); $CommonObject{GroupObject} = $Kernel::OM->Get('Kernel::System::Group'); $CommonObject{LinkObject} = $Kernel::OM->Get('Kernel::System::LinkObject'); $CommonObject{LogObject} = $Kernel::OM->Get('Kernel::System::Log'); $CommonObject{MainObject} = $Kernel::OM->Get('Kernel::System::Main'); $CommonObject{PIDObject} = $Kernel::OM->Get('Kernel::System::PID'); $CommonObject{QueueObject} = $Kernel::OM->Get('Kernel::System::Queue'); $CommonObject{SessionObject} = $Kernel::OM->Get('Kernel::System::AuthSession'); $CommonObject{TicketObject} = $Kernel::OM->Get('Kernel::System::Ticket'); $CommonObject{TimeObject} = $Kernel::OM->Get('Kernel::System::Time'); $CommonObject{UserObject} = $Kernel::OM->Get('Kernel::System::User');
which is working perfectly.Code: Select all
$CommonObject{FilterObject} = $Kernel::OM->Get('Kernel::System::PostMaster::Filter');
I hope that some of you can use this piece of information!
Regards, Tom
Re: Create PostMaster Filter via API
that was my first question if you are using rpc.pl which you denied..
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Re: Create PostMaster Filter via API
Hi,
sorry, but I did not deny it.
Instead I asked if there was something newer I need to know of.
I am sorry if that was confusing....
Anyway then: yes, I am using rpc.pl.
But please tell me now: what would be the "new" way you mention indirectly?
Thanks, Tom
sorry, but I did not deny it.
Instead I asked if there was something newer I need to know of.
I am sorry if that was confusing....
Anyway then: yes, I am using rpc.pl.
But please tell me now: what would be the "new" way you mention indirectly?

Thanks, Tom
Re: Create PostMaster Filter via API
there is the generic interface which actually only provide methos for ticket and CI generation. rpc.pl is direct, not abstracted connection to the OTRS API.
You also could use the API directly via perl script, without using SOAP...
You also could use the API directly via perl script, without using SOAP...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
-
- Znuny newbie
- Posts: 7
- Joined: 19 Feb 2015, 18:35
- Znuny Version: OTRS free 4.0.5
- Real Name: Tom
Re: Create PostMaster Filter via API
Hello,
I still have a small problem with the filters in OTRS.
When I go to Admin -> Postmaster-Filter, I can see my list of filters (I have 3 right now).
But when I call the FilterList API method, I get a list like the following:
In other words: each filter is listed twice. Why is that?
It is no coding error on the client side, for you can see I get decent IDs in the answer (like s-gensym1929).
Any suggestions?
Thank you very much!
I still have a small problem with the filters in OTRS.
When I go to Admin -> Postmaster-Filter, I can see my list of filters (I have 3 right now).
But when I call the FilterList API method, I get a list like the following:
Code: Select all
Array
(
[s-gensym1929] => checkout
[s-gensym1931] => checkout
[s-gensym1933] => Testfilter
[s-gensym1935] => Testfilter
[s-gensym1937] => Client A
[s-gensym1939] => Client A
)
It is no coding error on the client side, for you can see I get decent IDs in the answer (like s-gensym1929).
Any suggestions?
Thank you very much!