[rt-users] Scrip to check who updated a CustomField

Kevin Falcone falcone at bestpractical.com
Fri Nov 18 18:13:23 EST 2011


On Fri, Nov 18, 2011 at 04:03:49PM -0700, Brent Wiese wrote:
> 
> On Wed, Nov 16, 2011 at 03:35:09PM -0700, Brent Wiese wrote:
> >    I have scrips that will check the value of a custom field and perform actions based on it.
> > 
> >    But what I can't seem to figure out is how to show who made the custom field change.
> > 
> >    Specifically, I'm trying to compare who updated 2 custom fields. I have a case where I have a
> >    group of users allowed to change these 2 fields, but the same user isn't allowed to change
> >    both. So I need to compare who changed the 2 fields, and if they're the same user, perform an
> >    action (ie: set ticket stalled or email adminCC's or whatever).
> > 
> >    I'm pretty new to object oriented programming (especially under Perl), but it looks like I
> >    should be able to check "LastUpdatedBy"; I'm just not sure how.
> 
> I suspect you want the Transaction object's CreatorObj which will be the user who made the change.  Transactions don't tend to be updated, so LastUpdatedByObj should be the same as CreatorObj
> 
> -kevin
> 
> I'm not sure that would work. The case could be like this:
> User A selects a value for Field1
> User B selects a value for Field2
> User A reselects a value for Field2
> 
> If I understand what you've said, then my test would "pass" because the values were initially chosen (created) by different users. But I really want the above to "fail".
> 
> Or is that CreatorObj new every time the transaction happens?

Each of those is a single transaction.

Go create a test ticket with those cases and look at the transaction history for it.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111118/1a2cafe7/attachment.sig>


More information about the rt-users mailing list