Hi my friends,
How can I create a Macro (action) to change the status of one Change Request, after all request attached on her is approved?
A Change Request has 3 linked Requests. On the Request form (detail_cr), I have a checkbox that checks whether the incident was approved yes or no (bollean).
When all 3 requests are approved, an action macro is triggered and changes the status of a Change Request to a specific status.
The number of requests may vary between requests, same Changes can have a 3 or 8 requests.
Is that possible guys?
Normally I would implement the following approach:
1. Implement trigger that on request approval fires spel code that attaches event to your change request(https://communities.ca.com/docs/DOC-231162525)
2. Create event condition that checks if all request related to the change are approved. You can useget_list method for this
3. Create action macro that will change request status to approved if event condition check returns true (all requeswt approved)
I will try to use change tasks instead normal requests.
What I need to do is change the status of the change request when all change tasks related on the change are approved.
The tasks can be approved in anytime, they don't obey an order.
I presume that change order is approved if all task are approved, and rejected when any task is rejected. For simplicity you can update change status to cancelled when any task is rejected, since this will cancel any active or waiting task.
So in this case You can try to built the following workflow.
group start task
approval task 1 (does nothing if approved, set change status to canceled if rejected)
approval task 2 (does nothing if approved, set change status to canceled if rejected)
approval task 3 (does nothing if approved, set change status to canceled if rejected)
approval task 4 (does nothing if approved, set change status to canceled if rejected)
group end task (changes change status to approved if change status not equal to cancelled)
Notifying the Assignee of a Workflow Task when the Task Status changes