[rt-users] conditional template usage
Ruslan Zakirov
ruslan.zakirov at gmail.com
Tue May 16 17:42:38 EDT 2006
On 5/17/06, Bloom, Craig <Craig.Bloom at blackrock.com> wrote:
> That is really my question - how can you change/load a template from
> inside a custom condition?
I think no way without patching.
>
> If I have two separate scripts with two separate custom conditions, I
> will still need to know how to load a the appropriate template.
no, as you can create next scrips:
* "when we want use template1 do an action with template1"
* "when we want use template2 do the same action with template2"
>
> Any more thoughts?
>
> Thanks,
> Craig
>
>
> -----Original Message-----
> From: Ruslan Zakirov [mailto:ruslan.zakirov at gmail.com]
> Sent: Tuesday, May 16, 2006 4:45 PM
> To: Bloom, Craig
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] conditional template usage
>
> I think easiest way is to create two scrips. As I can see you couldn't
> change template from condition.
>
> On 5/16/06, Bloom, Craig <Craig.Bloom at blackrock.com> wrote:
> >
> >
> >
> >
> > I am trying to create a script with a custom condition that runs upon
> ticket
> > creation. Depending on the value of a user-defined field, the scrip
> should
> > use one template or another.
> >
> >
> >
> > So far, in my Custom Condition I have:
> >
> >
> >
> > if ($self->TransactionObj->Type eq "Create"){
> >
> > if ($self->TicketObj->FirstCustomFieldValue('Parent
> > Company') eq 'MY_COMPANY'){
> >
> > # LOAD TEMPLATE #
> >
> > } else {
> >
> > # LOAD DIFFERENT TEMPLATE #
> >
> > }
> >
> > return 1;
> >
> > }
> >
> > else{
> >
> > return undef;
> >
> > }
> >
> >
> >
> > Does this look right? What do I need to add in place of "# LOAD
> TEMPLATE #"
> > to get the scrip to load a template?
> >
> >
> >
> > Thanks,
> > Craig
> >
> >
> > THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
> > PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
> > DISCLOSURE. If the reader of this message is not the intended
> recipient, you
> > are hereby notified that any dissemination, distribution, copying or
> use of
> > this message and any attachment is strictly prohibited. If you have
> received
> > this message in error, please notify us immediately by replying to the
> > message and permanently delete it from your computer and destroy any
> > printout thereof.
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> > Community help: http://wiki.bestpractical.com
> > Commercial support: sales at bestpractical.com
> >
> >
> > Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> > Buy a copy at http://rtbook.bestpractical.com
> >
> >
> > We're hiring! Come hack Perl for Best Practical:
> > http://bestpractical.com/about/jobs.html
> >
> >
>
>
> --
> Best regards, Ruslan.
>
> THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM DISCLOSURE. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this message and any attachment is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and permanently delete it from your computer and destroy any printout thereof.
>
--
Best regards, Ruslan.
More information about the rt-users
mailing list