CA Service Management

 View Only
  • 1.  Spell MAcro for Request workflow task.

    Posted Jun 28, 2019 09:16 AM
    Hi Team

    We have below Action Macro for our Request workflows. The below macro is attached on 1st workflow task on pending status. 

    When an end user initiate a request, he/she select their Manager and save the ticket. WOrkflow task assignee field populates based on Manager field selection by end user. The below Macro works perfect for us.

    There is an Senior Manager field on detail_cr_wf.htmpl page so that once the 1st workflow task assignee aproved the request he should select his Manager and that manager should assign in 2nd workflow task assingee field.. 


    we have attribute in cr_wf object  for Senior manager field i.e 'z_hod'

    i loaded another same macro but change the attribute from 'cr.zanalyst' TO 'z_hod' and use this macro for second wf task on pending status.


    Now when i tested the flow again, ahen 1st task assignee select his S.Manager and approve the status. The second wf task assignee field not populating based on S.manager field selected in first task.

    What could be issue?


    #casdm17.1
    #caservicedesk17.0 



    ​​​​​


  • 2.  RE: Spell MAcro for Request workflow task.

    Posted Jun 29, 2019 10:22 AM
    i used below macro for second wf task on pending status but not worked..


    if ( !is_empty(z_hod))
    assignee = z_hod;



  • 3.  RE: Spell MAcro for Request workflow task.

    Posted Jul 01, 2019 08:48 AM
    Please can any one advise on this?


  • 4.  RE: Spell MAcro for Request workflow task.
    Best Answer

    Posted Jul 01, 2019 01:12 PM
    First, let's examine the macro that did work:
    1. You added a custom attribute (zanalyst) to the cr object.
    2. In a macro for the cr_wf object you referenced the custom attribute zanalyst in the cr object.
      1. This worked because there is a direct relationship (an SREL) between the cr_wf object and the cr object (using the cr attribute of the cr_wf object pointing to the persistent_id of the cr object). This SREL indicates that a Workflow Task (cr_wf instance) belongs to one Request/Incident/Problem ticket (cr instance).

    Now you added a custom attribute (z_hod) to the cr_wf object.
    • If you try to reference the z_hod attribute in a macro for the cr_wf object it will be referencing the attribute in the same cr_wf instance to which the macro is attached.
    • It seems that you are expecting it to reference the z_hod attribute in a different cr_wf instance. For this to happen you would need to develop a far more complex SPEL macro that would need to examine all the Workflow Tasks (cr_wf instances) associated to the same ticket (cr instance) with criteria to select out the specific Workflow Task you want to reference.


    ------------------------------
    Lindsay Estabrooks
    Principal Consultant
    IT-EDU Consultants
    ------------------------------



  • 5.  RE: Spell MAcro for Request workflow task.

    Posted Jul 05, 2019 10:12 AM
    Edited by Aamir Khan Jul 05, 2019 01:01 PM

    Hi Lindsay

    Thanks for your response

    Let ignore the 1st action macro which worked for another case.

    Now i have request workflow tasks.

    Task 1 -> Approve by group member

    Task 2 -> This task has custom field name Manager (attribute: z_manager [srel - > agt (analyst) ] in cr_wf object
                   Group member will select Manager Field  and then approve the task.

    Task 3 -> This task should have the assignee = Manager field selected in Task 2

    So on Pending status of Task 3, can you advise with action macro which will work like this.?

    Many Thanks