Is ticket's responsible can be set according to a dynamic field?
Moderator: crythias
-
- Znuny newbie
- Posts: 5
- Joined: 14 Jan 2015, 13:02
- Znuny Version: 4.0.3
- Real Name: deven
- Company: hc
Is ticket's responsible can be set according to a dynamic field?
I have OTRS 4 installed on RHEL 6. and i need a process which handles change request.
When a user submited a request, the request needs to be approved by his/her direct manager, if approved by direct manager, the ticket will be send to IT manager for approval.
The problem is, there are tens of departments, and in each department there are tens of managers. It is supposed that each manager only approves requests in his own unit. So I create a dynamic field called department, and assigned it to users activity dialog. Then the next step user will choose direct manager though a dropdown field. Then i need set the ticket responsible to the manager which user chosed in the previous step. That means I need to set ticket responsible to a dynamic value not a specify person.
It it possible to finish this process like I described above? I don't want to create each activity for each department/manager.
When a user submited a request, the request needs to be approved by his/her direct manager, if approved by direct manager, the ticket will be send to IT manager for approval.
The problem is, there are tens of departments, and in each department there are tens of managers. It is supposed that each manager only approves requests in his own unit. So I create a dynamic field called department, and assigned it to users activity dialog. Then the next step user will choose direct manager though a dropdown field. Then i need set the ticket responsible to the manager which user chosed in the previous step. That means I need to set ticket responsible to a dynamic value not a specify person.
It it possible to finish this process like I described above? I don't want to create each activity for each department/manager.
-
- Znuny newbie
- Posts: 5
- Joined: 14 Jan 2015, 13:02
- Znuny Version: 4.0.3
- Real Name: deven
- Company: hc
Re: Is ticket's responsible can be set according to a dynamic field?
any idea is appreciated. anybody have some idea?
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
I solved it with a custom event, because we can't yet upgrade to 4.0.x.
From 4.0.x (which you are using) you should be able to use the value of a dynamic field. So you'd need a field that is "hidden" and stores the value of the first responsible, to later on read that field again.
But what the exact syntax is, I cannot tell you. Did you try "DynamicField_NameOfYourField" ?
From 4.0.x (which you are using) you should be able to use the value of a dynamic field. So you'd need a field that is "hidden" and stores the value of the first responsible, to later on read that field again.
But what the exact syntax is, I cannot tell you. Did you try "DynamicField_NameOfYourField" ?
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
-
- Znuny newbie
- Posts: 5
- Joined: 14 Jan 2015, 13:02
- Znuny Version: 4.0.3
- Real Name: deven
- Company: hc
Re: Is ticket's responsible can be set according to a dynamic field?
Thank you very much for your reply.
Custom event solves my problem. Great!
But I really love the idea of using dynamic field. And I did several tests myself. I created a dynamic filed called "DirectManager", and when I set responsible to "DynamicField_DriectManager", the syslog returned error said "No UserID found for 'DynamicField_DirectManager'!"
I can hardly do it without dynamic field, otherwise I have to create hundreds of custom events to get it work.
Custom event solves my problem. Great!
But I really love the idea of using dynamic field. And I did several tests myself. I created a dynamic filed called "DirectManager", and when I set responsible to "DynamicField_DriectManager", the syslog returned error said "No UserID found for 'DynamicField_DirectManager'!"
I can hardly do it without dynamic field, otherwise I have to create hundreds of custom events to get it work.
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
Well, I can give you the exmpale that works for us, but again: I'm thought you could read the value of dynamic fields in transition actions from otrs 4.0.0 onwards.
1) Copy "TicketResponsibleSet.pm" from "Kernel/System/ProcessManagement/TransitionAction/" to "Custom/Kernel/System/ProcessManagement/TransitionAction/"
2) Search the file for the part where it declares the Success variable:
3) Imagin a not existing name which you will enter as "dummy" in your transition action, e.g. "DynamicFieldResponsible"
4) Edit this part:
To look something like this:
This way you do not need hundreds of events. Just a slightly modified perl file and a transition action (which has to be of type ResponsibleSet).
I hope this helps?
Best regards,
Rolf
1) Copy "TicketResponsibleSet.pm" from "Kernel/System/ProcessManagement/TransitionAction/" to "Custom/Kernel/System/ProcessManagement/TransitionAction/"
2) Search the file for the part where it declares the Success variable:
Code: Select all
my $Success
4) Edit this part:
Code: Select all
if (
defined $Param{Config}->{Responsible}
&& $Param{Config}->{Responsible} ne $Param{Ticket}->{Responsible}
)
{
$Success = $Self->{TicketObject}->TicketResponsibleSet(
TicketID => $Param{Ticket}->{TicketID},
NewUser => $Param{Config}->{Responsible},
UserID => $Param{UserID},
);
}
elsif (
defined $Param{Config}->{ResponsibleID}
&& $Param{Config}->{ResponsibleID} ne $Param{Ticket}->{ResponsibleID}
)
{
$Success = $Self->{TicketObject}->TicketResponsibleSet(
TicketID => $Param{Ticket}->{TicketID},
NewUserID => $Param{Config}->{ResponsibleID},
UserID => $Param{UserID},
);
}
Code: Select all
if (
defined $Param{Config}->{Responsible}
&& $Param{Config}->{Responsible} ne $Param{Ticket}->{Responsible && $Param{Config}->{Responsible} ne 'DynamicFieldResponsible'}
)
{
$Success = $Self->{TicketObject}->TicketResponsibleSet(
TicketID => $Param{Ticket}->{TicketID},
NewUser => $Param{Config}->{Responsible},
UserID => $Param{UserID},
);
}
elsif (
defined $Param{Config}->{ResponsibleID}
&& $Param{Config}->{ResponsibleID} ne $Param{Ticket}->{ResponsibleID}
)
{
$Success = $Self->{TicketObject}->TicketResponsibleSet(
TicketID => $Param{Ticket}->{TicketID},
NewUserID => $Param{Config}->{ResponsibleID},
UserID => $Param{UserID},
);
}
elsif ($Param{Config}->{Responsible} eq 'DynamicFieldResponsible')
{
$Success = $Self->{TicketObject}->TicketResponsibleSet(
TicketID => $Param{Ticket}->{TicketID},
NewUser => $Param{Ticket}->{DynamicField_DirectManager},
UserID => $Param{UserID},
);
}
else [... snip ...]
I hope this helps?
Best regards,
Rolf
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
-
- Znuny newbie
- Posts: 5
- Joined: 14 Jan 2015, 13:02
- Znuny Version: 4.0.3
- Real Name: deven
- Company: hc
Re: Is ticket's responsible can be set according to a dynamic field?
Awesome! It's just what I need.
I did the file copy and modification. Then I create a transition action like this:
Transition Action Module: TicketResponsibleSet
Config Parameters:
Key: DynamicFieldResponsible
Value: DynamicField_DirectManager
But the syslog still returns error said "No Responsible or ResponsibleID configured!".
Did I mistake something?
I did the file copy and modification. Then I create a transition action like this:
Transition Action Module: TicketResponsibleSet
Config Parameters:
Key: DynamicFieldResponsible
Value: DynamicField_DirectManager
But the syslog still returns error said "No Responsible or ResponsibleID configured!".
Did I mistake something?
You do not have the required permissions to view the files attached to this post.
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
Set key to 'Responsible' and value to 'DynamicFieldResponsible' if you used my example in the modified file.
Why?
These values are passed to the .pm file, which will recognize the string 'DynamicFieldResponsible' and hop into the modified ifelse command block.
Why?
These values are passed to the .pm file, which will recognize the string 'DynamicFieldResponsible' and hop into the modified ifelse command block.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
-
- Znuny newbie
- Posts: 5
- Joined: 14 Jan 2015, 13:02
- Znuny Version: 4.0.3
- Real Name: deven
- Company: hc
Re: Is ticket's responsible can be set according to a dynamic field?
Yes, It works! I just got confused by the value "DynamicFieldResponsible" and "DynamicField_DirectManager". Now I understand what you did with this custom module. You are a great lifesaver! Thanks!
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
Very welcome
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Re: Is ticket's responsible can be set according to a dynamic field?
and some code that works for OTRS 5
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
Should still work if you recreate the changes on the version 5 syntax.
For example instead of $Self->{TicketObject} you'd now use $Kernel::OM->Get('Kernel::System::Ticket')->
For example instead of $Self->{TicketObject} you'd now use $Kernel::OM->Get('Kernel::System::Ticket')->
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Re: Is ticket's responsible can be set according to a dynamic field?
still I get this error
You do not have the required permissions to view the files attached to this post.
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
Could you show us your line 120 ?
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Re: Is ticket's responsible can be set according to a dynamic field?
there it is.
In green line 120
In green line 120
You do not have the required permissions to view the files attached to this post.
-
- 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: Is ticket's responsible can be set according to a dynamic field?
For the future: Please post text not screenshots. That would make it a lot easier to help...
The line 120 should read:
The line 120 should read:
Code: Select all
&& $Param{Config}->{Responsible} ne $Param{Ticket}->{Responsible} && $Param{Config}->{Responsible} ne 'DynamicFieldResponsible'
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
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Is ticket's responsible can be set according to a dynamic field?
Excellent thank you very much for your help dear !!!!
Re: Is ticket's responsible can be set according to a dynamic field?
Hi,
I use dynamic field from database from OTRS Business Solution and take alle values from a database table. No code changes needed, makes upgrades easy
works like a charm.
Flo
I use dynamic field from database from OTRS Business Solution and take alle values from a database table. No code changes needed, makes upgrades easy
works like a charm.
Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11
-- 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.
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11
-- 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.
Re: Is ticket's responsible can be set according to a dynamic field?
How to create a ticket with DynamicFields
Re: Is ticket's responsible can be set according to a dynamic field?
How to create a ticket with DynamicFields???
-
- Znuny newbie
- Posts: 6
- Joined: 27 Sep 2016, 19:08
- Znuny Version: 5.0.0
- Real Name: Tiago Struck
Re: Is ticket's responsible can be set according to a dynamic field?
Hi,
I have problem with Transition Action > TicketCreate
I need pass information of a DynamicField of a process to a new ticket. But i can´t.
Somebody can help-me?
Tnks,
I have problem with Transition Action > TicketCreate
I need pass information of a DynamicField of a process to a new ticket. But i can´t.
Somebody can help-me?
Tnks,
-
- Znuny newbie
- Posts: 36
- Joined: 07 Sep 2016, 16:15
- Znuny Version: 5.0.13
- Real Name: Christian Moeller
- Company: Prüfinstitut Hansecontrol
- Location: Hamburg
- Contact:
Re: Is ticket's responsible can be set according to a dynamic field?
Thank you very, very much for that, Rolf! That works perfectRStraub wrote: ...
I hope this helps?
Ein Dosenfisch stürzt sich lachend ins offene Meer
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Is ticket's responsible can be set according to a dynamic field?
You're very welcome
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS