meta data de esta página
  •  

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
aplicaciones:rt:funcionamiento [2010/05/05 12:37] lcaplicaciones:rt:funcionamiento [2023/01/18 14:36] (actual) – editor externo 127.0.0.1
Línea 41: Línea 41:
 === Definiendo la plantilla === === Definiendo la plantilla ===
  
-Lo primero que necesitamos es crear una plantilla local a la cola +Lo primero que necesitamos es crear una plantilla local a la cola que hemos creado (en mi caso compras)
 {{:aplicaciones:rt:rtplantilla.png?700|}} {{:aplicaciones:rt:rtplantilla.png?700|}}
  
Línea 48: Línea 48:
  
 Las dependencias entre el ticket creado y el ticket de aprobación hace necesario que este último deba ser cerrado primero. Las dependencias entre el ticket creado y el ticket de aprobación hace necesario que este último deba ser cerrado primero.
 +
 +=== Creamos la acción ===
 +Creamos una acción dentro de la cola compras para que al crear un nuevo ticket automáticamente se cree un ticket de aprobación
 +
 +Vamos a la cola compras->Acciones ->Nueva acción:
 +
 +Descripción: crear aprobación
 +Condición: On Create
 +Acción: Create Tickets
 +Plantilla: Aprobar comprar (la plantilla creada anteriormente)
 +Fase: TransactionCreate
  
  
Línea 53: Línea 64:
  
 Si necesitas diferentes grupos de usuarios para acceder a diferentes conjuntos de aprobaciones, necesitas crear nuevas colas. Si necesitas diferentes grupos de usuarios para acceder a diferentes conjuntos de aprobaciones, necesitas crear nuevas colas.
 +
 <note tip> Los ticket del tipo aprobación no aparecen en la lista de ticets normales, aparecen al pinchar sobre la opción Aprobación </note> <note tip> Los ticket del tipo aprobación no aparecen en la lista de ticets normales, aparecen al pinchar sobre la opción Aprobación </note>
  
-<note warning> Para utilizar la cola por defecto ___Approvals para nuestras aprobaciones, hay que activar la cola, renombrar el nombre a approvals y dar permisos a los usuarios autorizados a ver la cola y los tickets (sólo se puede hacer dando permisos Globales.) You'll want to grant ShowTicket to AdminCC's (which ever role your template attaches the approving group to the approval ticket as+<note warning>Para utilizar la cola por defecto Approvals para nuestras aprobaciones, hay que activar la cola y dar permisos a los usuarios autorizados a ver la cola y los tickets (sólo se puede hacer dando permisos Globales.) 
-Example using PO Requisition Approvals+</note>
  
-Create a PO-Req queue for PO Requisitions.. this is where the tickets get created which need approval. Enable this queue and add users who are allowed to submit PO Requisitions to this queue with necessary permissions.+También deberás dar permisos para ver los tickets **ShowTicket** a los AdminCC 
  
-Create the following template named "Create Approval":+En AdminCC de la cola Approvals ponemos lo usuarios o grupos que sean los responsables de aprobar los tickets.
  
-===Create-Ticket: poreq +Para añadir mediante scripts un grupo para aprobar las peticiones, tenemos que modificar la plantilla (en nuestro caso) la de aprobación de compras y dejarla como sigue: 
-Subject: Approve purchase order for {$Tickets{'TOP'}->Subject}+<file>  
 +===Create-Ticket: compras 
 +Subject: Aprobar comprar de {$Tickets{'TOP'}->Subject}
 Depended-On-By: TOP Depended-On-By: TOP
-Queue: Approvals-PO +Queue: Approvals
 Type: approval Type: approval
-Owner: username-of-owner   #note this is so that notifications work properly +AdminCC: { 
-Content: Someone has created a purchase requisition.  Please review and approve it, so they can spend some money. +   my $group_name  = 'grpjefes';
-ENDOFCONTENT +
- +
- +
-If you want multiple approvals, just add more "===Create-Ticket:" sections +
- +
-and the following Scrip: +
- +
-Description: Create PO Req approval +
-Condition: On Create +
-Action: Create Tickets +
-Template: Create Approval +
-Stage: TransactionCreate +
- +
- +
-Create queue Approvals-PO, and copy the templates and scrips from the [__]Approvals queue. (Leave the [__]Approvals queue disabled and its templates unaltered for future reference). If you want an easy way to copy these templates/scrips.. I have none.. it was copy/paste. +
- +
-You could do this in Mysql with commands such as: +
- +
-insert into Scrips (Queue, Description, ScripCondition, ScripAction, ConditionRules, ActionRules, CustomIsApplicableCode, +
-CustomPrepareCode, CustomCommitCode, Stage, Template, Creator, Created, LastUpdatedBy, LastUpdated) select NEWQUEUENUM, +
-Description, ScripCondition, ScripAction, ConditionRules, ActionRules, CustomIsApplicableCode, CustomPrepareCode, +
-CustomCommitCode, Stage, Template, Creator, Created, LastUpdatedBy, LastUpdated from Scrips where Queue=2; +
- +
-insert into Templates (Queue, Name, Description, Type, Language, TranslationOf, Content, LastUpdated, LastUpdatedBy, Creator, +
-Created) select NEWQUEUENUM, Name, Description, Type, Language, TranslationOf, Content, LastUpdated, LastUpdatedBy, Creator,  +
-Created from Templates where Queue=2; +
- +
- +
-Set the Reply Address and Comment Address to the email address of the "PO-Req" queue. This just makes sense. +
- +
-Enable this queue and add as AdminCCs the user(s) you wish to be the Approver(s). +
- +
-In the scrip for "When an approval ticket is created..." change the following condition from User Defined to "On Create"+
- +
-The "Approval Passed" Template says "Ticket Rejected" in the subject.. please change to "Ticket Approved". The "All Approvals Passed" Template says "Ticket Rejected" in the subject.. please change to "Ticket Approved"+
- +
-There you have it. Hope this helps. +
-Group Approvals +
- +
-Sometimes you want to create tickets so that any one person from a group can approve it. One way to do that is as follows: +
- +
-Create a group that contains the list of users that can approve. In the Approval template, add an AdminCC field. This will contain the group, but you cannot just list the group name, unfortunately; that would just create an unprivileged user with the same name as the group. You have to list the group's Principal ID. I suppose you could find out what that is manually and enter it directly, but that's not very manageable. Instead, put some Perl code in the field as follows: +
- +
- AdminCC: { +
-   my $group_name  = 'Group Name';+
    my $groups      = RT::Groups->new( $RT::SystemUser );    my $groups      = RT::Groups->new( $RT::SystemUser );
  
Línea 123: Línea 92:
    $groups->First->Id;    $groups->First->Id;
 } }
 +Content: Alguien ha creado un ticket que debe se aprobado o rechazado
 +ENDOFCONTENT
 +</file>
  
 +También podemos definir una acción en la cola Approvals para cambiar el estado del ticket padre si el ticket de aprobación es rechazado. Para ello vamos a la cola Approvals y creamos una nueva acción con lo siguiente:
  
-This inserts the ID of the group named "Group Name" in the AdminCC field. Be sure to replace the group named "Group Name" with the appropriate name of your group. + {{:aplicaciones:rt:rtcambiarpadre.png?700|}}
- +
-Now you need to modify permissions for the Queue that contains the Approval so that the AdminCC role can approve it. +
- +
-Now when you create a ticket with approvals, the approval will show the group name and all of its members in the AdminCC field, and anyone listed there can approve that ticket. If the user that approves it also takes it, then you can easily see in the original ticket's "Depends On" section who approved it. You can automate this via another scrip. Create the following scrip on the Approval queue: +
- +
-Condition: On Resolve +
-Action: User Defined +
-Template: Global Template: Blank +
-Stage: Transaction Create +
-Custom Action Preparation Code: +
-  my $Actor = $self->TransactionObj->CreatorObj->Id; +
-  if( $Actor != $self->TicketObj->OwnerObj->Id ) { +
-    $RT::Logger->info("Auto assign ticket #"$self->TicketObj->id ." to user #". $Actor ); +
- +
-    my ($status, $msg) = $self->TicketObj->SetOwner( $Actor ); +
-    unless( $status ) { +
-      die "Error: $msg"; +
-    } +
-  } +
-  return( 1 );+
  
 +Si necesitamos dos aprobaciones, pero que una sólo se cree una vez aprobada la primera, entonces podemos utilizar el siguiente script: 
 +\\ http://www.gossamer-threads.com/lists/rt/users/66127?search_string=multiple%20approval;#66127
  
-One of the features of doing it this way is that you can continue to have a single Approval queue and different people can approve different tickets since the rights are based on the AdminCC role and not a specific user or group.+==== Delegar ==== 
 +Para delegar necesitamos los isguientes permisos: 
 +  * AdminOwnPersonalGroups 
 +  * Delegate Rights 
 +  * Ver Grupo
  
-http://wiki.bestpractical.com/view/ApprovalCreation+y para poder ver los grupos personales que están dentro de las pestaña preferencias hay que tener además el permiso ModifySelf
  
 +===== Referencias =====
 +  * http://wiki.bestpractical.com/view/ApprovalCreation
 +  * http://wiki.bestpractical.com/view/OpenDependantsOnResolve