In 7.6 it possible to add a function that returns the current user to a calculation.
It might be possible to use this in a calculated condition to fulfil the above requirement.
There are some details on page 37 of the 7.6 new features guide:
Yep, I'd agree with Calvin.
In 7.6 you can use the GetCurrentGroupName() function to return the name of the current Group you are logged in as. If you system is setup such that only Analysts are in Groups then a test of != null would confirm if they are an Analyst. However for solutions where end users can also be in groups (company, customer etc) then you'd have to delve deeper; use the GetObjectByAttribute function on the System.Group object with the name just returned. Then once you have that object check it's type for "Support Group" as that should then equate to an Analyst.
try the following calculation for your precondition in the Incident Object:
import System static def GetAttributeValue(User): CurrentUser = User.GetCurrentUserName().ToLower() UserName = User.GetObjectByAttribute("System.User", "Name", CurrentUser) if UserName.UserType.Name == 'Analyst': return String.Format("Analyst") return String.Format("No Analyst")
and set the comparsion value for the precondition to "Equal to Analyst".
Hope that helps
Or if they've created an object (e.g., Note, Assignment, Task, etc.), here's another calc that works:
static def GetAttributeValue(Incident):
Value = Incident.Notes.Latest().CreationUser.UserType.Title
Have your comparison check if the return value equals "Analyst", and of course adjust Incident/Note to reflect whatever process and object you're working with.
the problem reffering to the CreationUser is, that this won't work in WebAccess or SelfService because of the runtime environment.
As long as the action isn't saved you won't be able to pick up the creatuion user type.
Yeah, to clarify I actually meant you could use this type of calc in a process condition/action that follows another action where the user has created something like a note/reminder/etc by referring to Coll.Latest().CreationUser to get the type.
e.g., with an Add Note action at the Closed status, I've placed a follow-up decision checking the Type for CreationUser... if it's Analyst nothing happens, any other type shoves it into a Waiting Reopen status.
You're right that this won't work trying to refer to the current object being created, if that's what you are trying to do. I am a little anxious to move to 7.6 and check out the new features.
your right, if you want to move the process different ways depending on the Creation User User Type you can do this with your calculation and a process decision.
If you want to display an action depending on the current user user type, you'll need to use my calculation shown above and put it in a precondition to the process. This is only possible qith 7.6 and later, as there are these runtime functions available in calculations.
There is a big feature of 761 that allows access to the process relationship data BEFORE the action is saved. Make sure you grab the post 5th July release though!
This is fantastic and works great! Thanks guys .
I'm on 7.7.2 and it looks like this doesn't work in WebAccess, only in console