Hello Everyone, now i am trying to create workorder for each SR with status NEW but i want to make this process through Automation Script because i want to copy some specific fields from the sr to the created workorder.
I have tried the following:
- first method: i have created the escalation with condition status = 'NEW'
- Empty condition Escalation Point
- action group which have:
- Applicaiton Action Create WO
- Script that copy my desired fields, change current sr status to inprogress and apply sla on the workorder
the escalation is running and only the first action is seems done but the script is not running or running without making what i am waiting for.
i have attached the script.
the used relation in the script is from SR to Workorder ==> status = 'NEW'
AND origrecordclass = 'SR'
AND origrecordid = :ticketid
AND createdate = (
SELECT MAX(createdate)
FROM workorder
WHERE origrecordclass = 'SR'
AND origrecordid = :ticketid
AND status = 'NEW'
)
-----------------------------------------------------------------------------------------------
Also i have tried to create the workorder from scratch using an script without using the application action and then copy the desired attributes and then appling the SLA on the created workorder by invoking workflow from the script that has apply SLA application action.
I have attached the script .
----------------------------------------------------------------------------------------------
Both ways are not working i need to know why.
------------------------------
Abdullah Blal
Software Engineer
Megasoft
Giza
+201155119254
------------------------------