- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2015 02:33 PM
Im wondering if anyone know how I can use templates within call.
We had this function in our old system and ServiceDesk used it alot.
To explain it abit more. if Im looking at a call and for example say it is an incident. I then choose call_type "incident" and then also get the choos(if I want) which of the templates I want to use. After this I press "submit/save". This is very useful when it's quick incidents where servicedesk handles them. Then They just need to choose the right template at the call which then creates the incident and puts it as resolved etc. directly. Now they need to choose incident, press submit, right click, go into templates etc...
Anyone done this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2015 03:54 AM
This is what I did to make it work. I did it with the OOB way to create incident since we have changed our way.
Preferable is to just copy the oob-rules etc. and edit that and inactive the OOB ones to still get the future upgrades on the originals once in case you want to see what is new etc.. Here I'm just editing the real ones.
1. Create a reference field on call named "incident template". When you create it you can choose any field you want since the template-table isn't in the choice list.
* Choose Configure dictionary on incident template.
* Change the reference field to the table template(sys_template).
* Add the ref qual condition "Table IS incident" to just see incident templates.
2. Edited the Business rule "CallTtypeChanged"
* Add the following line: gr.u_incident_template = current.u_incident_template;
3. Create an UI policy so that the field "incident template" only shows if the call type is incident.
* Set the condition to "Call type IS incident".
* Make sure the "reverse if false" is checked.
* Make a UI Policy Action on field "u_incident_template". and set visible to true.
Now everything with the call is done. And lets head to incident.
1. Do the same first step as we did with call. We'll make it exact the same if we want to build some more functionality later on it.
* Create a reference field on call named "incident template". When you create it you can choose any field you want since the template-table isn't in the choicelist.
* Choose Configure dictionary on incident template.
* Change the reference field to the table "sys_template".
* Add the ref qual condition "Table IS incident" to just see incident templates.
2. Create an UI policy that hides the field "incident template".
* No condition since we never want the field to be visible. But we still need it in the form to be able to change it etc.
* Make a UI Policy Action on field "u_incident_template". and set visible to false.
3. Create a onLoad script that will apply the template when the incident is loading. Efter its applyed it will empty the incident template field otherwise it will apply every time the incident is loaded.
* Add the following code:
function onLoad()
{
//Get the value from the field.
var template = g_form.getValue('u_incident_template');
//Check so the field isnt empty
if(template != '')
{
//Apply the template
applyTemplate(template);
//Wait 2 seconds before clearing the value with the function clearTemplate
setTimeout(clearTemplate,2000);
}
}
function clearTemplate()
{
//Empty the field
g_form.setValue('u_incident_template', '');
}
And now it should be working 😃 Let me know if you have any other questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 10:50 AM
nice to hear 😃
Let me know if you got any other things you want to solve, or throw some ideas around. I aint a supercoder, but atleast I can be used as a sounding board 😃
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 08:35 AM
Sorry to revisit this after such a long time however I'm finding that when we assign a template to a call as you describe and I've implemented. The new incident initially gets assigned to the Service Desk (our default group) and only when opened for the first time does the template get applied.
Any thoughts?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 12:29 AM
Hi amacqueen,
Sorry for the late reply, I'm hitting my summer vacation now, but it's lousy weather so the community is a nice spot to visit
Ahh one of my first creations 😃 Just before I answer you question I would just want to say that I would rather put the template name in a display BR and fetch the template name from scratchpad. This way you didn't need to put the field on the form and a ui policy to hide it.
But anyway, you're right, since the template is applied with a onLoad, that is what happens. What's needs to be done here is to move the functionality to a insert BR on incident to make it happen when it's created and in that case you don't need the display BR I mentioned before.
I guess I made this in the days were I was more comforted in Client scripts that Business Rules. Let me know if you need help with resolving this with a BR instead.
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2015 02:05 AM
That's great Göran looking forward to seeing it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 12:44 AM
Thanks for the input Goran.
I would appreciate your input as whilst i can read 'some' java script' I'm hopeless at writing it.
What could I do to both the existing BR on Call and the new one on incident?
Hope the weather improves for you soon 🙂