CA Service Management

 View Only
Expand all | Collapse all

Emergency Change Workflow Approvals

Jump to Best Answer
  • 1.  Emergency Change Workflow Approvals

    Posted Dec 12, 2017 08:33 AM

    I have investigated a few ways to do this and want to reach out to see if I am going the best way about this. For the Change Category Emergency Change (only this one) we would like:

             1. When submitter hits approved, it goes to their manager for approval (this is currently setup)

             2. If their manager doesn't approve in 24 hours, the same approval task goes to their manager's manager

             3. If not approved after 48 hours, it then goes to their manager's, manager's, manager (CIO)


    Our LDAP configuration only has immediate supervisor, not sure if we can call that two additional times in the code. What I thought needed done is to create subsequent tasks and then auto-assign the task which will generate a notification. However, I don't know if that will work because to go to the next task it would have to be "Approved" when in fact it is moving to the next one for approval; and if it did get approved I would have to SKIP the following two.


    Not sure the best approach. I have also looked at exceeded duration conditions, other time based macros, and work shift modifications; any suggestions/ideas would be appreciated.

  • 2.  Re: Emergency Change Workflow Approvals

    Posted Dec 12, 2017 08:52 AM

    Hi Jessie - this is an interesting use case.  I have not come across anything like this myself, but its possible some other folks have and may be willing to share their experiences with you.  I think you are correct in saying that it wont be able to call two additional times in the code to get to manager's manager's manager... that would be an interesting one.  Not quite sure on the best approach myself here.  In service desk, we only have one level of "manager" on a given contact - and there is no object for cnt.manager.manager type of thing available - so I am not sure how to make it query those two "hops" that way.  Great use case though - like a built in escalation process.

    Anyone have any ideas here for Jessie?

    Jon I.

  • 3.  Re: Emergency Change Workflow Approvals

    Posted Dec 12, 2017 03:39 PM

    Is there a way to have a Service Type attach to a change order that can mark a specific Workflow task as failed if it remains in a status for a certain period of time?

  • 4.  Re: Emergency Change Workflow Approvals

    Posted Dec 12, 2017 08:57 AM

    Hi Jessie,


    Have you considered using ITPAM? For the bit of complexity, ITPAM would be the best fit, rather than Classic Workflow.


    That was my 2 cents...



    Kind Regards,


  • 5.  Re: Emergency Change Workflow Approvals

    Posted Dec 12, 2017 03:57 PM

    You can have predefined three approval tasks

    You can attach service type for each task. This service type will contain one event that will fire after predefined time and will set status of the task to some status (e.g. cancelled) by using action macro. In second task you can use behaviour template condition to check if previous task was approved/rejected or cancelled. If task was approved/rejected  you can set current approval task status to skip if it was cancelled you will assign current task to manager of the manager (You will need to create new action macro for this):


    uuid who; 
    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); 


    send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "assignee", chg.affected_contact.supervisor_contact_uuid.supervisor_contact_uuid); 

    //for higher  chg.affected_contact.supervisor_contact_uuid.supervisor_contact_uuid.supervisor_contact_uuid

    if (msg_error()) { 
    logf(ERROR, "Error trying to assign the task %s for the chgange %s. Error message %s", task.sym, chg.chg_ref_num, msg[0]);

  • 6.  Re: Emergency Change Workflow Approvals

    Posted Dec 12, 2017 09:34 PM

    Here is an outline for a 'spel' approach, using a single event.  If you need more detail on how to attach events to a task and so on, I'm sure one of us can help.

    When the approval task goes pending, use a 'behavior' to attach a non-repeating event to the task with a 24 hour delay.  The macro launched by the event will do the following.  (The value 'N' referred to below can be configured in the 'Text' field on the event and will then be accessible as 'user_smag' from the running event).

    If (task status == Pending) then

    Read the field 'zReferral_count' from the task; //'zReferral' will be a new integer field in the

    // object 'wf', defaulting to 0

    If (zReferral_count < 'N') then

    Look up the current assignee's manager;

    Reassign the task to the current assignee's manager and send a notification;

    Increment 'zReferral_count' and save the updated task;

    Attach a new instance of the same event to the task with a 24 hour delay;

    Else (zReferral_count >= 'N') so

    Set the task status to 'Failed to be approved';




    Let me know if you'd like more details.



  • 7.  Re: Emergency Change Workflow Approvals

    Posted Mar 07, 2018 02:38 PM

    I have a quick question for the pdm_load of a macro. When doing a pdm_extract of the macro table it shows the bracketed \\0012 for new lines in the "fragment" column. However, when I do a straight DB pull of the information from the SQL Server DB it does not have them in the "fragment" column. Do i format it with the \\0012 line brackets before doing a pdm_load of the data?

  • 8.  Re: Emergency Change Workflow Approvals

    Posted Mar 08, 2018 05:17 PM


  • 9.  Re: Emergency Change Workflow Approvals

    Posted Mar 16, 2018 12:53 PM

    I am very close to getting this but not sure the best way to finalize it. When the tasks complete and go to the next supervisor, how do I "SKIP" subsequent tasks once it is approved? I have site-defined conditions for the current task itself to attach an SLA, etc. but I am not sure how to reference the previous task to see if it is approved so the current task (and subsequent tasks) can be skipped if need be. I am trying to avoid changes to the overall Change process (to create site-defined conditions) since this will only be used for the Emergency Change Category.


    Start Approval (Chg Creator)

    Approval (Supervisor doesn't approve in time)

    MGRApproval (Approves it and I need workflow to stop and SKIP next task)

    MGRMGRApproval (not needed)

  • 10.  Re: Emergency Change Workflow Approvals
    Best Answer

    Posted Mar 20, 2018 01:37 AM

    I'd approach this by creating a site-defined condition 'zPreviousTaskApproved' to use in the 'Pending' behaviour for the 'MGRMGRApproval' task - set the task status to SKIP if the condition returns True.


    The condition would do this:

    • look up all tasks for the current chg, having sequence less than this task's sequence (use 'sync_fetch');
    • traverse the list of returned objects to find the task with the highest sequence (there is no 'order by' or SQL 'max' operator in the 'sync_fetch' function, and you cannot assume that tasks will be retrieved in sequence number order - I've been stung by that one :-) );
    • retrieve the status of that task;
    • return True if the status is Approve, or False otherwise.


    I'm sure you can fill in the details yourself, but one of us will help out if not.




  • 11.  Re: Emergency Change Workflow Approvals

    Posted Mar 21, 2018 09:53 AM

    Thank you Sir. I found this documentation you posted to a question earlier.

    How to skip request workflow task automatically 

    Would I just replace these conditions with 10, 20, and 30 in the code?

    I do have three approval tasks, how would i have the third task in sequence look to the previous task to see if it is APP or SKIP?  

  • 12.  Re: Emergency Change Workflow Approvals

    Posted Mar 22, 2018 08:49 AM

    Can I add or 'SKIP' to the code like below:

    "chg=%d and sequence=10 and status='APP' or 'SKIP'", theChg