Technical Blog Post
Abstract
Automation Script: How to create a WO from a SR when some condition is satisfied
Body
You may want to create a Work Order(WO) automatically when saving a SR record if a condition for a field is satisfied.
Please reference below automation script example.
The case: If WOREQUIRED attribute's value is true when saving a SR record whose asset number is 11230, create a WO from that SR.
Please follow the steps.
1. Go to the Database Configuration application
2. Open TICKET object
3. Create the attribute "WOREQUIRED" with YORN type. The default value is set as 0. Apply DB Changes in Admin Mode.
4. Go to the Application Designer application - Open SR application.
5. Add a checkbox control for the "WOREQUIRED" attribute.
6. Save
7. Go to the Automation Scripts application.
8. Create Script with Object Launch Point
Click Create
By this automation script, when saving an existing SR record whose Asset Number is 11230, if WOREQUIRED field is checked, a followup WO will be created.
9. Now, go to the Service Requests application.
Open a SR
- Set ASSETNUM with 11230, set SITEID with BEDFORD and have WOREQUIRED checked.
- Save
Then, you can see that a follow up WO is created.
This is a simple test case. You may need to add more logic in script based on your requirement.
UID
ibm11131753