Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

SD 4.5 Autoupdate

SOLVED
Go to solution
Highlighted
Haytham Nour
Regular Collector

SD 4.5 Autoupdate

Dear ALl;

I created custom feild in SLA to count the SLA consumption (Integer Incident A, Integer Incident B)

Now I want to automate whenever an Incident A or B is created to increment the count for each of them based on the incident type.

I am using SD4.5 and tried doing this using the DB rules, however when choosing the action to be update data action, and select related items, I can't find the SLA neither the feilds.

Please advice... thanks in advance.
12 REPLIES
George M. Meneg
Honored Contributor

Re: SD 4.5 Autoupdate

Hello,

I think there is a reason for that. The SLA is automatically calculated for service calls and incidents (and that's way it appears read only on the form).
menes fhtagn
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

I created custom feilds in the SLA with as Number type named "Incident A" and "Incident B"
So whenever I open a case (Service Call) that is a type of Incident A I need to decrement the counter in the SLA feild.

This is exactly what I need to do. Please advice
George M. Meneg
Honored Contributor
Solution

Re: SD 4.5 Autoupdate

You CANNOT do this through db rules on service calls/incidents unless the db/ui rules is calling an external script (preferably web-api) that will update the related SLA.

The other approach is to use "service" as an intermediate providing that there is each service has at most one related SLA. In that case when a service call's SLA is not empty then update a custom service boolean.

This will trigger a db rule on services to update related sla's custom field (that's why you need only one SLA per service).

Have in mind that this won't work on SP22 without a specific hotfix (I don't recall the ITSM document)
menes fhtagn
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

Again you can't take an action to update any feild in the Service when A service call is created. The Service Call related Items doesn't include SLA neither Services. And accordnilgy I can update the SLA Data.

What do you think? If you have such a script to do that I will be so greateful.
Thanks in advance
George M. Meneg
Honored Contributor

Re: SD 4.5 Autoupdate

Hello,

There is a confusion. The "Select a related item" on the db rules is for one to many relations and not for 1 to 1 relations. So, you won't find service in related items. Instead you gonna find service in Fields menu.

Using that you can update a service boolean field.

A db rule will be triggered and in a Service DB rule you will be able to select SLA on related items since the relation between service and sla is one to many. And this is why using this method IS NOT ADVISED, because if service is linked to more than one SLA, then ALL the SLAs will be updated.

As for the script, I don't have such a script. However using WEBAPI you could do almost anything. Knowledge of java and good knowledge of OVSD is required.
menes fhtagn
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

Dear George;

I can't get still how to update a Service Feild triggering a Service Call condition.
Can you give me an example exactly describing what you mean?
Thanks for your advice, however, One Service os only linked to one SLA.
thanks
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

Dear George,
I managed to do what I wanted. But I want to do another thing.

In case the feilds are Date type. I created Feild Duration1 as custom in service call.

And when I consume this duration, I add the time to custom Date time in service and set a boolean to true.
Now when I want to Subtract the time consumed between the SLA and Service using a Service DB Rule, the custom Date time in SLA is not displayed.

What do you think?!
Vasily Kamenev
Honored Contributor

Re: SD 4.5 Autoupdate

Hi
I to do next: create db rule with condition by type. Then rule must run the script, I used the Java, but in My case I'm increment or decriment a spend time and summaru in SLA. The script is attached, use as example.

Vasily
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

Dear Vasily;

thanks for your reply.

However as I saw from the script, it calls the duration from the work order.

The case is that I want when the SC is closed (The actual duration will be known at then from Duration feild) to decrement that for the duration feild in the SLA named custom 1.

So does your script does this? or what?
Forgive me but I am not good in scripting.
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

For more clarification regarding my case.

I need to decrement the time spent (duration) for solving the SC from the SLA Duration cutome feild linked to the organization of the caller. as I have many SLA per each departmenet.

I wish I am clear enough now
Vasily Kamenev
Honored Contributor

Re: SD 4.5 Autoupdate

HI
I told before: "use as example".
Yes, WOs to SLA. In your case more easy, +1 or -1. Of' course you need wrote the other script where you doing increment or decrement in SLA filed.

Vasily
Haytham Nour
Regular Collector

Re: SD 4.5 Autoupdate

Thanks the script is really helpfull
//Add this to "OnDomLoad" event