In Service Desk 7.8 I am trying to add two Incident Process Preconditions that 1) tests whether the currently logged in user is an analyst; and 2) tests whether the currently logged in user is the raise user. In both cases I am using a calculation. They are being used to show or hide actions. We want the analyst to be able to say "the customer's equipment was delivered to them," where we want the customer to be able to say "I received my equipment;" we do not want analysts saying "I received my equipment" unless they happen to also be the customer, nor do we want the customer to declare the equipment was delivered (as "I received my equipment" is a certification, the other is a claim that requires proof from the analyst).
The first precondition calculation appears to be working correctly - it shows for analysts, not for end users. The second does not - it always shows for analysts, never for end users, even if they are the raise user.
Both calculations exist under Incident Management > Incident > Condition:
First calculation - Current User Is Analyst (appears to work)
import System static def GetAttributeValue(Incident): CurrentUserAnalyst = false UserName = Incident.GetCurrentUserName().ToLower() CurrentUser = Incident.GetObjectByAttribute("System.User", "Name", UserName) if CurrentUser.UserType.Name == 'Analyst': CurrentUserAnalyst = true return CurrentUserAnalyst
Second calculation - Current User is Raise User (does not work)
import System static def GetAttributeValue(Incident): RaiseUserIsCurrentUser = false if Incident.RaiseUser.Name.ToLower() == Incident.GetCurrentUserName().ToLower(): RaiseUserIsCurrentUser = true return RaiseUserIsCurrentUser
For each, I add the precondition to the process, draw an arrow to the precondition, and draw another arrow from the precondition to the action. The actions both show up only (and always) for analysts. This makes me think that there is another method by which these are being hidden or displayed; I just cannot seem to locate it.
Any assistance will be appreciated, and I am happy to provide further information if requested. Thank you!