Creating special Activities – Part 1/2

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.

image

image

image

image

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.

image

image

image

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.

image

image

If needed, you can prepopulate attributes. In this case, I only populate the Display Name.

image

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.

image

image

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!

image

image

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”.

image

Again, some fields can be prepopulated if needed.

image

image

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.

image

image

image

image

image

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.

image

image

Now check the added Activity Templates and fill in the details to order the database.

image

image

After the Change Request is saved, the new Activity will be visible in our created view.

image

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

This entry was posted in SCSM and tagged , , , , , , . Bookmark the permalink.

11 Responses to Creating special Activities – Part 1/2

  1. Pingback: Creating special Activities – Part 2/2 | SCSMfaq.ch

  2. Rong Yi says:

    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

      • Rong Yi says:

        Hi Marcel,
        I exactly followed the steps of this post. It is courious that I did a second time and error disappeared.

  3. Emre says:

    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

  4. 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

  5. Patrick Hersing says:

    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

      • Patrick Hersing says:

        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.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s