ArticleTemplate and replies to several reporters

Hello,

The “Reply to reporters” feature from an Incident is quite nice… But I
was wondering, is there any way for an RTFM Article (that uses
RTFM::ArticleTemplate), used in such a “multi”-reply, to include the
report ticket numbers instead of the incident ticket number?

Currently i use:
[{ $Ticket->QueueObj->SubjectTag || $rtname } #{ $Ticket->id }]

But what i get is all the reports that are replied to contain the linked
incidents ticket number instead of each reply its own ticket number.

Hope that made sense :slight_smile:

Kind regards
Michal Wodzinski, DK-CERT (UNI-C)
3587 8817 / 2483 2451
PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)

The “Reply to reporters” feature from an Incident is quite nice… But I was
wondering, is there any way for an RTFM Article (that uses
RTFM::ArticleTemplate), used in such a “multi”-reply, to include the report
ticket numbers instead of the incident ticket number?

I solved this one (granted, a workaround…) by simply rephrasing the
message to something like: see the subject field for the ticket number.

But now I’m having another interesting challenge with regards to
ArticleTemplates.

RT::FM includes an option (RTFM_TicketCreate) to enable RTFM Article use
on ticket create pages (especially useful when doing an investigate to
from Lookup.html). This is really nice.

But when Create.html uses an RTFM Article, it doesn’t work with the
RTFM::Extension::ArticleTemplates extension. It actually borks on
ParseTemplate() not being able to reach $Ticket, which should be
$TicketObj passed from Create.html. This isn’t being passed on entirely as
it should (or just not passed).

I’ve been poking around in

  • html/RTFM/Article/Elements/Preformatted
  • html/Callbacks/RTFM/Ticket/Create.html/BeforeCreate
    in the RT::FM plugin directory, and
  • html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent
    in the RTFM::Extension::ArticleTemplates plugin directory, and other
    places, but can’t quite seem to get it right…

Any ideas where to start to make it work?

The error and call stack from an apache error log is:
[Wed Jan 12 11:27:27 2011] [error]: Article parsing error: Can’t call method “CustomFieldValues” on an undefined value at template line 6.

Stack:
[template:6]
[/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:75]
[/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:19]
[/opt/rt3/share/html/Elements/Callback:52]
[/opt/rt3/local/plugins/RT-FM/html/RTFM/Article/Elements/Preformatted:112]
[/opt/rt3/local/plugins/RT-FM/html/Callbacks/RTFM/Elements/MessageBox/Default:78]
[/opt/rt3/share/html/Elements/MessageBox:49]
[/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:226]
[/opt/rt3/share/html/Widgets/TitleBox:51]
[/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:249]
[/opt/rt3/bin/…/lib/RT/Interface/Web.pm:320]
[/opt/rt3/bin/…/lib/RT/Interface/Web.pm:224]
[/opt/rt3/share/html/autohandler:53] (/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:70)
[Wed Jan 12 11:27:27 2011] [error]: Couldn’t parse article’s content: Article parsing error (/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:21)

and the undefined value at template:6 is $Ticket->CustomFieldValues(‘IP’);
in this specific example. The RTFM Article (+ template code) works from
Update.html.

Kind regards
Michal Wodzinski, DK-CERT (UNI-C)
3587 8817 / 2483 2451
PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)

Hello,

Sadly enough on create ticket object is not available on create as
there is no ticket at the moment. Your article templates should be
aware that ticket is not always available and use conditions.On Wed, Jan 12, 2011 at 2:26 PM, Michal Wodzinski michal.wodzinski@uni-c.dk wrote:

On Tue, 4 Jan 2011, Michal Wodzinski wrote:

The “Reply to reporters” feature from an Incident is quite nice… But I
was wondering, is there any way for an RTFM Article (that uses
RTFM::ArticleTemplate), used in such a “multi”-reply, to include the report
ticket numbers instead of the incident ticket number?

I solved this one (granted, a workaround…) by simply rephrasing the
message to something like: see the subject field for the ticket number.

But now I’m having another interesting challenge with regards to
ArticleTemplates.

RT::FM includes an option (RTFM_TicketCreate) to enable RTFM Article use on
ticket create pages (especially useful when doing an investigate to from
Lookup.html). This is really nice.

But when Create.html uses an RTFM Article, it doesn’t work with the
RTFM::Extension::ArticleTemplates extension. It actually borks on
ParseTemplate() not being able to reach $Ticket, which should be $TicketObj
passed from Create.html. This isn’t being passed on entirely as it should
(or just not passed).

I’ve been poking around in

  • html/RTFM/Article/Elements/Preformatted
  • html/Callbacks/RTFM/Ticket/Create.html/BeforeCreate
    in the RT::FM plugin directory, and

html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent
in the RTFM::Extension::ArticleTemplates plugin directory, and other places,
but can’t quite seem to get it right…

Any ideas where to start to make it work?

The error and call stack from an apache error log is:
[Wed Jan 12 11:27:27 2011] [error]: Article parsing error: Can’t call method
"CustomFieldValues" on an undefined value at template line 6.

Stack:
[template:6]
[/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:75]
[/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:19]
[/opt/rt3/share/html/Elements/Callback:52]
[/opt/rt3/local/plugins/RT-FM/html/RTFM/Article/Elements/Preformatted:112]
[/opt/rt3/local/plugins/RT-FM/html/Callbacks/RTFM/Elements/MessageBox/Default:78]
[/opt/rt3/share/html/Elements/MessageBox:49]
[/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:226]
[/opt/rt3/share/html/Widgets/TitleBox:51]
[/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:249]
[/opt/rt3/bin/…/lib/RT/Interface/Web.pm:320]
[/opt/rt3/bin/…/lib/RT/Interface/Web.pm:224]
[/opt/rt3/share/html/autohandler:53]
(/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:70)
[Wed Jan 12 11:27:27 2011] [error]: Couldn’t parse article’s content:
Article parsing error
(/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:21)

and the undefined value at template:6 is $Ticket->CustomFieldValues(‘IP’);
in this specific example. The RTFM Article (+ template code) works from
Update.html.


Kind regards
Michal Wodzinski, DK-CERT (UNI-C)
3587 8817 / 2483 2451
PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)


Rtir mailing list
Rtir@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rtir

Best regards, Ruslan.

Sadly enough on create ticket object is not available on create as
there is no ticket at the moment.

There still is $TicketObj? I know it’s not “the current ticket” but
the parent ticket as seen from Create.html, but still…

Your article templates should be aware that ticket is not always
available and use conditions.

True about using conditions, in this specific case it’s testing :slight_smile:

I changed
<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => $include_signature &>
to
<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => $include_signature, Ticket => $IncidentObj &>
in local/plugins/RT-IR/html/RTIR/Create.html, and it actually works.

I can’t see if there are any indirectly related caveats. I’ll fiddle a bit
more with this solution.

Kind regards
Michal Wodzinski, DK-CERT (UNI-C)
3587 8817 / 2483 2451
PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)