function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
petec@i2isyspetec@i2isys 

Formula to determine if case moved from queue to a user

Has anyone done a workflow to fire if case ownership changes from a queue to a user?  I'm trying to do this but keep getting errors with this:

AND( ISPICKVAL( Origin , 'Contract-to-Case') , ISCHANGED(  OwnerId ),PRIORVALUE( Owner:Queue.Id  = '00G3300000283g5') )

Error: Incorrect argument type for function 'PRIORVALUE()'.
Anthony McDougaldAnthony McDougald
Good Evening petec,
Hope that your day is off to an amazing start. We've fixed your workflow. Please test and report back when you get the chance. Hope this helps and may God bless you abundantly.
AND( 
ISPICKVAL( Origin , 'Contract-to-Case') , 
ISCHANGED(  OwnerId ) ,
PRIORVALUE( Owner:Queue.Id ) = '00G3300000283g5' 
)


Best Regards,
Anthony McDougald
Danish HodaDanish Hoda
Hi Petec,
Please try this:
AND(
ISPICKVAL( Origin , 'Contract-to-Case'),
ISCHANGED( OwnerId ) ,
LEFT(PRIORVALUE(OwnerId), 3)  = '00G',
LEFT(OwnerId, 3) <> '00G'
)
petec@i2isyspetec@i2isys
Anthony, Thank you so much.
Unfortunately, it is saying PRIORVALUE can't reference the Owner:Queue.Id field.  I'm trying to send an alert when ownership of case is changed from Queue to a standard user.User-added image
petec@i2isyspetec@i2isys
Hi Danish,
Hey thank you, that worked in that there are no errors.
HOWEVER, we have several case queues and I only need this notification to fire if this exact queue is the initial owner: 00G3300000283g5

Is there a way to adjust this so maybe the last 3 or 4 of the ID are looked at instead of the first 3 characters?

Thanks!
Danish HodaDanish Hoda
Hi Petec,

Then you can simply use:

AND(
ISPICKVAL( Origin , 'Contract-to-Case'),
ISCHANGED( OwnerId ) ,
PRIORVALUE(OwnerId)  = '00G3300000283g5',
LEFT(OwnerId, 3) <> '00G'
)
petec@i2isyspetec@i2isys
Hi Danish, that was it, worked perfectly, thanks so much!