Working with ‘Managers’ and ‘Direct Reports’ within Service Manager 2012 Service Requests

Recently I was working with a customer on a ‘New User Provisioning’ process where a couple of the requirements were to have the user (an IT user) create new users via the Service Manager Self-service Portal.  The user would be prompted for various pieces of information pertaining to the new users – one of which would be the users ‘Manager’.

Now, this is relatively straight forward.  All we need to do is when creating the request offering we create a prompt for ‘Manager’ and make this a Query Results type.  Then when configuring the prompt, I can select a Combination Class (or Type Projection) as the target Class.  Selecting the User (Advanced) Type Projection enables us to use the Manages relationships to query for Managers and Direct Reports.  The relationships are called the same thing, but for reference, the first Manages relationship is a Direct Report and the second one is the Manager.  All good stuff.

image

SNAGHTMLd6b545

image

image

However, when testing the offering via the Self-service Portal I was getting strange results.  9 times out of 10 the User picker would return no results:

SNAGHTMLe3f491

SNAGHTMLe4eff8

Now as we know a Type Projection is essentially a database query that joins many tables and returns all the data found in each table.  In the case of the User (Advanced) Type Projection this amounts to 11 classes (or tables) in total – the User class and then ten related classes.  So, if we use the User (Advance) combination class, we are returning lots of data  most of which we do not need.  Essentially what was happening was that the request was timing out before the data could be returned.

So what I decided to do was create my own Type Projection that had only the relationships that I needed – the two Manages relationships.  What these actually are is the same relationship (System.UserManagesUser) defined twice within the type projection, and one of them (the ‘Manager’ relationship) has a SeedRole=’Target’ property set. 

Once I created the Management Pack containing my new Type Projection I sealed and imported it.  I then changed ‘the ‘Manager’ prompt in my request offering to use the new Type Projection, named User (Manager and Direct Reports) instead of the previous User (Advanced) type projection.   

image

image

image

Notice this time the Type Projection only has three classes from which it will return data.  Much more efficient!

image

Now when I attempted go through the request in the Self-service Portal the performance of the query is much improved returning the results almost instantaneously!!

SNAGHTMLfb65f8

I’ve posted this solution to the TechNet Gallery for your consumption – let me know if it helps.

1 thought on “Working with ‘Managers’ and ‘Direct Reports’ within Service Manager 2012 Service Requests

  1. Great stuff, works perfectly, and much faster to load.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

search previous next tag category expand menu location phone mail time cart zoom edit close