change priority based on the number of items (articles) in a ticket

Moderator: crythias

Locked
janmeeremans
Znuny newbie
Posts: 3
Joined: 02 Jan 2016, 16:04
Znuny Version: 5.050
Real Name: Jan Meeremans
Company: Myriade

change priority based on the number of items (articles) in a ticket

Post by janmeeremans »

Hi,

I would like to change status of a ticket based on the number of articles that are available in a specific ticket.

We want to send alarms from a sensor to OTRS.
We know that receiving only one sensor alarm is not important, but if we get multiple alarms short after each other we need to escalate or change the priority of the ticket.

I have been testing with generic agent to do the following but I do not find a working solution:
1. When a ticket is having 2 articles, send a notification to a group
2. When a ticket has only 1 article and has not been updated for 2 hours, the ticket can be deleted.

I hope somebody can point me to a solution.

Jan Meeremans
Myriade Belgium
Jan Meeremans
Myriade Belgium
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: change priority based on the number of items (articles) in a ticket

Post by crythias »

There is no function of quantity. However, you can force a change to a field and test the field for a value.

Something like:
  • create a text ticket dynamic field (DF) called AlertCount
  • Create (several) GenericAgent events on ArticleCreate. Filter on event ArticleCreate. Test Ticket DF AlertCount. If value is 1, set to 2. If 2, set to 3, etc. (use Ticket Create or PostMaster Filter to set initial value). Make sure notifications are enabled/yes for the GA.
The problem with this (maybe) is that it might loop through all the values so you may want to add a test for "And last change > 3 minutes ago". or something appropriate.

But since you have control over this instead of a flat increment, you can use better wording to describe the concept for the field:
"First notice"
"Second notice"
"Hey, maybe someone should check this..."
"This is still a problem!"
"You know, if you are still getting this and you haven't fixed this, you might want to turn the alarm off."

Then use a Notification (Event) to react to ArticleCreate and the appropriate exact value of AlertCount.

Note that *lots* of things make "articles" so if you filter on articles that relate to alerts, that will reduce the false positive.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
janmeeremans
Znuny newbie
Posts: 3
Joined: 02 Jan 2016, 16:04
Znuny Version: 5.050
Real Name: Jan Meeremans
Company: Myriade

Re: change priority based on the number of items (articles) in a ticket

Post by janmeeremans »

Hello Crythias,

Thank you for your suggestion. It gives me some ideas.
However I cannot make it run. As you said it might loop and it does.
I played with the "last changed time" and "changed times" parameters, but I seem not able to solve this.
I also thought to be smart and force the order by adding numbers in front of the description, but unfortunately that did not work either.

anybody more suggestions?

Jan Meeremans
Myriade Belgium
Jan Meeremans
Myriade Belgium
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: change priority based on the number of items (articles) in a ticket

Post by wurzel »

Hi,

there is a xlst interface. This can count and do some more stuff (combined with Generic Interface?)

I have seen it from a xxx member in a presentation. But I am not able to re-produce this on my own. The guy counted the "locks" on a ticket it worked fine. Maybe this is an option? But please do not ask me for a "how to" :(


Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
janmeeremans
Znuny newbie
Posts: 3
Joined: 02 Jan 2016, 16:04
Znuny Version: 5.050
Real Name: Jan Meeremans
Company: Myriade

Re: change priority based on the number of items (articles) in a ticket

Post by janmeeremans »

Hi all,

I have been playing further and found a field "timeunits".
With generic agent I could add a note and augment the "time units (work units)" with 1.
This results in augmenting the "accounted time" the ticketinformation.
Based on that number I can decide to take action.

I also found in the API the function ArticleCount(). So using this we would also be able to solve this I presume.
http://otrs.perl-services.de/docs/otrs/ ... ticle.html


Jan Meeremans
Myriade Belgium
Jan Meeremans
Myriade Belgium
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: change priority based on the number of items (articles) in a ticket

Post by reneeb »

If you add a note with genericagent, the number of articles is increased... So you would need to check for other attributes of the significant articles as well (e.g. sender, article type). And you would need to setup several generic agents to set the priority of the ticket (one generic agent for every possible value of the timeunits that matches a new priority).

I would write a small ticket event module that listens to the ArticleCreate event, And the module would check if the ticket is from the specific ssender (may depend on the ticket customer or the subject). If it is an (open) ticket from the sender it counts the nr. of articles that are relevant for this task (send by "customer" and it is an email). If the nr of articles is greater than or equals 2, increase prio.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked