After installing Service Manager there are two types of activities that can be used in Change Requests: Manual Activities and Review Activities. When planning a Change Request you can chain multiple of those activities together. unfortunately, the attributes of those activities are hardcoded and any special information that you want to include in the Change Request has to be entered in the description field. However, with a little bit of customization it’s possible to create custom activities that hold exactly the information you will need.
In this first part I will show how to prepare everything. For this example i will create a custom activity called “Database Order Activity” that will later be used to order new Databases. I will create three attributes for the activity: Database Servername, Database Name and Database Size. After that, I will also create the needed Templates to make the order process as easy as possible. Now let’s take a look at the needed steps … there are some.
Step 1 – Create a new Activity Class
First, we need a custom activity class. To create this a new Management Pack has to be created in the Authoring Tool. Then, the default activity class needs to be extended. The customizations are then stored in a new class in an unsealed Management Pack.
After the new (extended) class is created, the needed attributes are added. Make sure you choose the correct Data Type for each attribute. But first, the automatically created key property can be deleted.
The Management Pack is now ready to be imported into the Service Manager environment.
Step 2 – Creating the Templates
Now it’s time to create the needed templates. First we need an activity template based on the newly created activity class we created before.
If needed, you can prepopulate attributes. In this case, I only populate the Display Name.
Now I create another Template for a Change Request that will hold a single activity. This activity is a “Database Order Activity” based on the template we created a minute ago.
Caveat: When you create a Change Request Template that holds one or more Activity Templates, all Templates must be stored in the same Management Pack if it is not sealed!
Now the Change Request Template can be prepolulated with Activity Templates. In this example we’re gonna add a single Activity Template of our “Database Order Activity”.
Again, some fields can be prepopulated if needed.
Step 3 – Creating the View
Now, to see the new Activities, a new view must be created. This view could be created anywhere, but I will add it to the Activity Folder that exists out of the box.
Step 4 – Using the Templates
After all the work, we want to test the new templates. Create a new Change Request based on the created template.
Now check the added Activity Templates and fill in the details to order the database.
After the Change Request is saved, the new Activity will be visible in our created view.
Wow, this indeed is really because you can collect all the needed information for an activity. Of course, you could also use the description or notes attribute to collect this information, but this way you are not sure if the change request-/activity creation is consistent.
But even cooler than this is the fact, that you can use exactly this information to automate the activity with Opalis! In the next post i will show you how to do this in detail – stay tuned!
Marcel
Pingback: Creating special Activities – Part 2/2 | SCSMfaq.ch
Hi Marcel,
Thank you for guide. An error occurred when I created the activity following your guide. The error occurred at the last point of step 2. After I added the activity in activities tab and click OK button, an error “Failed to verify ObjectTemplate: Template 70c4e15abfec4503825f7dae982a60fd Cannot process request because the host management pack is null. Remember to call the Reconnect method on the element with name and type ManagementPackRelationship.” happened. Could you tell me what is the matter and how to solve it? Thank you very much!
Hey
Hmm, not sure. Did you try to create the templates without default values? Just wonder if that works …
regards
Marcel
Hi Marcel,
I exactly followed the steps of this post. It is courious that I did a second time and error disappeared.
Hello,
i want to ask you about activity descriptions.
we want to send a notification e-mail to user who is responsible for doing the job itself.
we create the notofication template.Template has 1 approve and 1 manual activity.
we approve and send workflow triggers the manula activity to assigned user.
But assigned user must look the portal to see change request to understand what to do.
The thing is important for us;we want to add change request description to assigned manual activity so that assigned user can understand what to do easily from sent mail.
Hey
I have not done this yet, but I guess this should be possible by using the correct relations between Change Requests and Activities. From the correct Change Request projection (System.Workitem.ChangeRequestProjection) you can access the activities that belong to it and vice versa. With that, it should be possible to reach your goal.
regards
Marcel
Hello, thank you for this post. Do you know if it is posible to use such a custom task in a service request?
Hey
The only thing I tried so far is extending the existing Service Request Class with additional attributes – that worked as expected. But I bet creating a completely new class works the same way as shown in this post. But again, I never tried it myself.
regards
Marcel
Hi Marcel,
I need a custom activity for incidents. I tried your solution, but the new activity class does not appear as new selectable option if I want to add a new activity to an incident. Do you know a possibility to create a custom activity for incidents?
Thanks
Hey
2 things here … (1) Did you create a template with your new activity class and (2) do you have the appropriate permissions to access this template based on your user role?
Cheers
Marcel
Hi,
(1) Yes, I created a template as you described. I can use the template for change, problem, release management and so on. But the incident seems different, at inicidents I select a class and not a template…
(2) I am administrator with full permissions.