Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rtir
Commits
3db519e8
Commit
3db519e8
authored
Aug 25, 2011
by
Ruslan Zakirov
Browse files
RT::IR->MapStatus( $status, $from => $to ) method
parent
e0702e3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
12 deletions
+37
-12
html/RTIR/Incident/Reply.html
html/RTIR/Incident/Reply.html
+3
-12
lib/RT/IR.pm
lib/RT/IR.pm
+34
-0
No files found.
html/RTIR/Incident/Reply.html
View file @
3db519e8
...
...
@@ -144,18 +144,9 @@ if ( $SubmitTicket && !$checks_failure ) {
push @results, map { loc("Ticket [_1]: [_2]", $id, $_) }
ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS );
my %additional;
if ( $Status ) {
$additional{'Status'} = $incident_cycle->MoveMap(
$Ticket->QueueObj->Lifecycle
)->{ $Status };
unless ( $additional{'Status'} ) {
RT->Logger->error(
"No mapping for $Status in Incidents queue"
.' to status in '. $Ticket->QueueObj->Name .' queue'
);
}
}
my %additional = (
Status => RT::IR->MapStatus( $Status, $incident_cycle => $Ticket ),
);
unless ( RT::IR->IsLinkedToActiveIncidents( $Ticket, $IncidentObj ) ) {
push @results, ProcessTicketBasics(
...
...
lib/RT/IR.pm
View file @
3db519e8
...
...
@@ -418,6 +418,40 @@ sub IsLinkedToActiveIncidents {
return
$tickets
->
Count
;
}
sub
MapStatus
{
my
$self
=
shift
;
my
(
$status
,
$from
,
$to
)
=
@_
;
return
unless
$status
;
foreach
my
$e
(
$from
,
$to
)
{
if
(
blessed
$e
)
{
if
(
$e
->
isa
('
RT::Queue
')
)
{
$e
=
$e
->
Lifecycle
;
}
elsif
(
$e
->
isa
('
RT::Ticket
')
)
{
$e
=
$e
->
QueueObj
->
Lifecycle
;
}
elsif
(
!
$e
->
isa
('
RT::Lifecycle
')
)
{
$e
=
undef
;
}
}
else
{
my
$queue
=
RT::
Queue
->
new
(
RT
->
SystemUser
);
$queue
->
Load
(
$e
);
$e
=
$queue
->
Lifecycle
;
}
return
unless
$e
;
}
my
$res
=
$from
->
MoveMap
(
$to
)
->
{
$status
};
unless
(
$res
)
{
RT
->
Logger
->
warning
(
"
No mapping for
$status
in
"
.
$from
->
Name
.
'
lifecycle
'
.
'
to status in
'
.
$to
->
Name
.
'
lifecycle
'
);
}
return
$res
;
}
sub
GetCustomField
{
my
$field
=
shift
or
return
;
return
(
__PACKAGE__
->
CustomFields
(
$field
))[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment