[SOLVED] How to change automatically an article subject?

Moderator: crythias

Locked
LuciferSam
Znuny newbie
Posts: 17
Joined: 17 Apr 2012, 21:39
Znuny Version: 3.1.10

[SOLVED] How to change automatically an article subject?

Post by LuciferSam »

Hi there. I wish to know how to change automatically a subject when I insert an article with a certain note type.

Example:
1) I add a note with a note type "internal-update"
2) Automatically OTRS should change the subject with "Call update"

I've tried with a trigger in Postgres BEFORE INSERT, but with no luck. OTRS said that he cannot find the ArticleID.

How can I manage that?

OTRS: 3.1.10
PostgreSQL: 9.1.5

Thanks.
Last edited by LuciferSam on 14 Sep 2012, 13:03, edited 1 time in total.
OTRS 3.1.10 on Debian Wheezy
PostgreSQL 9.1
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to change automatically an article subject?

Post by crythias »

use a javascript onchange in your .dtl for that.
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
LuciferSam
Znuny newbie
Posts: 17
Joined: 17 Apr 2012, 21:39
Znuny Version: 3.1.10

Re: How to change automatically an article subject?

Post by LuciferSam »

Thank you, for your answer.
Where I can find an example? Or what file should I change?

The articles are in agent view
OTRS 3.1.10 on Debian Wheezy
PostgreSQL 9.1
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to change automatically an article subject?

Post by crythias »

something like this added to AgentTicketActionCommon.dtl
search on the interwebs for things like jquery, value, dropdown, select, change, text.

Code: Select all

<script type="text/javascript">//<![CDATA[
    $('#ArticleTypeID').bind('change', function (Event) {
      if ($(this).text() == 'note-external') (
          $('#Subject').text('Not a note');
     )
    });
//]]></script>
This code may have bugs, is not tested, and probably doesn't work.
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
Locked