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

Sharing a tip: Workorders within Service Calls & Automation

SOLVED
Go to solution
Highlighted
George M. Meneg
Honored Contributor

Sharing a tip: Workorders within Service Calls & Automation

Hello all,

Today I managed at last to create an automation for service calls and related workorders.

The goal is this: If a service call needs one or more workorders in order to be completed, we wanted an automation to change service call status to "Waiting for workorder" and when the last workorder is closed, change the status to "In Progress" and notify the workorder(s) requestor (who in our implementation is the assignee of the service call) that the workorder(s) are closed.

It looked fairly simple but it give me headaches and for sometime I thought that it was not possible.

Well, at last I managed to do it and post the solution in case you find it useful.
menes fhtagn
12 REPLIES
Jasper Verweij
Honored Contributor
Solution

Re: Sharing a tip: Workorders within Service Calls & Automation

George,

thank you very much for sharing this info.

I had accomplished part of this task with a web-api send to me by John Bouchard and some own coding.

These API-files are attached and provided as-is.

CheckWorkorderStatus2 updates change status (like "In Progress") when ALL linked workorders have a specific status (like "Ready").

UpdChangeStatusFromWo updates change to specific status when NO other linked workorders has a status with state "Not accountable" (like "Waiting for customer").

Both web-api files has a parameter to sleep the api for a while to let other db rules to be executed/evaluated. Otherwise the API might fail.

CheckWorkorderStatus2
Please enter the correct number of args.
Args 1 - Server (Service Desk Server)
Args 2 - UserName (Service Desk UserName)
Args 3 - Password (Service Desk Password)
Args 4 - Ticket No (Change Ticket Number)
Args 5 - Workorder status closed
Args 6 - Next Change status (eg. Closed)
Args 7 - Time to sleep before executing (in seconds)

UpdChangeStatusFromWo - Change status update if workorder has specific status
stateor none of the related workorders has this status state.

Jasper Verweij, Westbury, november 2004

Please enter the correct number of args:
Args 1 - Server (Service Desk Server)
Args 2 - UserName (Service Desk UserName)
Args 3 - Password (Service Desk Password)
Args 4 - CH Ticket No (Change Ticket Number)
Args 5 - Next Change status (eg. Closed), if needed
Args 6 - WO Ticket No (Workorder Ticket Number)
Args 7 - Check Workorder State (eg. Accountable, Not Accountable, etc.)
Args 8 - Time to sleep before executing (in seconds)

Example parameters:
localhost system servicedesk 142 "Implemented" 748 "Not Accountable"

This example will update Change record 142 to Implemented if none of the
related workorders has a not accountable state (like "wait for customer").
This example will also update Change record 142 to Implemented if workorder 748
has state of state "Not Accountable".
UpdChangeStatusFromWo works with following check diagram:

Q1: Has the change workorders related?
A. Yes, go to Q2
B. No, nothing will happen, code will be exited

Q2: Is state of status of workorder id specified with argument 6
equal to the Check Workorder State (argument 7)?
A. Yes, this means that the Change might get updated. Go to Q4
B. No, go to Q3

Q3: Has 1 of the other related workorders a state of status
equal to the Check Workorder State (argument 7)?
A. Yes, this means that the Change shouldn't be
updated.Nothing will happen, code will be exited
B. No, go to Q4

Q4: Is Change status already the same as specified with argument 5?
A. Yes, this means that the Change shouldn't be updated.
Nothing will happen, code will be exited
B. No, Update Change with status specified as argument 5
and exit code.

NOTE: A change of Change status might require that certain fields
must be filled.

George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

Jasper deserves full points for his detailed tip. (Sorry Jasper for being late, I almost forgot this topic :))
menes fhtagn
Alain_18
Regular Collector

Re: Sharing a tip: Workorders within Service Calls & Automation

Hi George,

I'm trying to implement your incrementing of No of Orders in an UI rule without success.

I'm not able to register ( 1.0 + [No of Workorders]).

Would you post screenshots about it.

Thank you
Bye
Alain
George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

Alain,

Before doint the arithmetics, the no of workoders must be initialized. Create a ui rule that when a new item is opened to set no of workorders to 0
menes fhtagn
Alain_18
Regular Collector

Re: Sharing a tip: Workorders within Service Calls & Automation

Hi George!

Thank you for replying.

I initialize an other way (through templates) since "ID after creation" is not checked.

But, still, i can't understand how you can set ( [Service call;No of wordorders] + 1) in your 2 workorder DB rules.

I only can set ( [No of workorders] + 1) in a DB rule.

I can do it in an UI rule but not in a DB rule.

Best regards
Alain
George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

Hello Alain,

You have to *type* on the workorder db rule definition the
Service call;no of workorders, you cannot select it from the "fields" menu.

Something else. The same work on service desk 5 with one change: You haven't to type "service call;no of workorders" you are able to select it from the fields menu.
menes fhtagn
Vlee_1
Super Collector

Re: Sharing a tip: Workorders within Service Calls & Automation

Hi I am looking for the same solution using api, unfortunately the attachment here is corrupted. Can you please reattach a new one.
thanks.
George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

Hello,

I can open the attachment, it's not corrupt.
menes fhtagn
Vlee_1
Super Collector

Re: Sharing a tip: Workorders within Service Calls & Automation

Hi, this this the message I go when I tried to open / save the attachment:
The compressed (zipped) folder is invalid or corrupted.
can you please kindly send the attachment to this email: vlee@tusc.com.au

George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

The attachment is not zipped. It's a .doc file.
menes fhtagn

Re: Sharing a tip: Workorders within Service Calls & Automation

I can open George's attachment, but not Jaspers. I also get the "corrupted file" error. It happens with many attachments here, I think it's the forums.

Michael
George M. Meneg
Honored Contributor

Re: Sharing a tip: Workorders within Service Calls & Automation

I can open both my attachment and Jasper's just fine. Have you tried with firefox?
menes fhtagn
//Add this to "OnDomLoad" event