[Rt-commit] [rtir] 01/09: Add a "constituency for" method to RT::IR

Jesse Vincent jesse at bestpractical.com
Mon Mar 16 02:41:33 EDT 2015


This is an automated email from the git hooks/post-receive script.

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit 2648968ae5a9d441333f9ef30777c4674939afab
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Mar 15 19:40:31 2015 -0700

    Add a "constituency for" method to RT::IR
    
    Add a "constituency for" method to RT::IR that returns to the constituency of an RTIR ticket.
---
 lib/RT/IR.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 8726a72..206f72f 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -796,8 +796,22 @@ XXX TODO
 
 =cut
 
+=head2 ConstituencyFor $Ticket
 
+Returns the textual constituency name for any RTIR ticket.
+Returns undef for non-RTIR tickets.
 
+Dies if handed something that's not a ticket
+
+=cut
+
+
+sub ConstituencyFor {
+    my $self = shift;
+    my $ticket = shift;
+    die "$ticket is not a ticket object" unless ref($ticket) && $ticket->isa('RT::Ticket');
+    return $ticket->QueueObj->FirstCustomFieldValue('RTIR Constituency');
+}
 
 require RT::Search::Simple;
 package RT::Search::Simple;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list