CIRESON PORTAL: DYNAMIC FORMS BY TEMPLATE ID, PART 3

Following up our posts in this series from last week, today we are going to quickly show how we can set a template ID in a Service Request template so that the template ID is always set on SR creation.

The first step in this process is to create a new Service Request template, making sure to place the template in a new management pack so it’s easy to work with and update as needed in the future:

2016-02-10_14-43-10

Next, lets set a default Title and fill in the required Urgency and Priority fields. If desired, fill in any other related fields you’d like applied to the SR when the template is used:

2016-02-10_14-44-41

Save the SR template. Now we are going to export the new management pack we saved the template into and make a few changes.

Open the management pack XML file that you exported with your text editor, here I’m using Visual Studio Code.

Search for the <Templates> tag with the nested <ObjectTemplate> tag. In the case that you have stored several templates in this MP we are looking for the one that has the matching /Title$ property that we set when we saved the template:

2016-02-10_14-49-25

Now we are going to add our template ID property like the below image shows:

2016-02-10_14-51-09

Make sure that when you are setting the property in the XML that you are targeting the ServiceRequest class, as the TemplateId property is not a property of the base WorkItem class, but the ServiceRequest class itself.

Now save the management pack and import it back into Service Manager:

2016-02-10_14-52-52

That’s all there is to it! From there you can create a new SR from the newly edited template and when you view the TemplateId for the request in Powershell or the Portal you should see your preset value:

2016-02-10_15-16-20

One thought on “CIRESON PORTAL: DYNAMIC FORMS BY TEMPLATE ID, PART 3

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 )

Connecting to %s