CA Service Management

 View Only
Expand all | Collapse all

SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

  • 1.  SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 10:15 AM

    I would like to add the approval task comments field to the message template for the 'Abandon/Cancel' CO message template. 

     

    Does anyone know the syntax to use in the message template for this?

     

     

    Thanks.

    Tammy



  • 2.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 02:57 PM

    HI Tammy, not sure I fully follow you. can you explain a little more what you are trying to archive?

    Rgds,

    /J



  • 3.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 03:37 PM

    Sure, thanks.  So when the approval task of a change order is rejected, the analyst puts information in the task comments explaining why it was rejected.  Then change order is then cancelled, and the 'Abandon/Cancel' CO message template sends an email to the customer letting them know it was cancelled.  But there is nothing in that email to tell the customer why it was cancelled.  I would like to include the approval task's 'task comments' field in that message template, but I don't know the correct syntax for that.   The workflow task attribute for the task comments field is 'comments', but I'm not sure what the syntax should be to include in the message template.  The current message template contents are shown below:

     

    Cancelled by: @{analyst.combo_name}

    Assigned to: @{change_id.assignee.combo_name}

    Requested By: @{change_id.requestor.combo_name}

    For: @{change_id.affected_contact.combo_name}

    Priority: @{change_id.priority.sym}

    Need By: @{change_id.need_by}

    Description: @{change_id.description}

     

    Click on the following URL to view Change Order:

    @{change_id.web_url}

     

    Thanks.

    Tammy



  • 4.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 05:57 PM

    Hi Tammy,

     

    I don't think this is possible without customization.  The workflow comments are stored in the WF schema while the notifications are able to pull from the chg and chgalg schemas.  When you update a workflow status an Update Status activity is added to the change logs, however it doesn't copy the comments from wf.comments to the change activity log.

     

    A possible solution to this is requiring Comments on your status transitions from any status to Cancelled.  When the Analysts comments in the status transition popup that comment is saved to the change logs.  The status transition comment would then be reportable using the code, @{description}.



  • 5.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 06:54 PM

    Thanks for the response, Grant.  However, when the analyst is approving or rejecting the approval task, they aren't changing the status of the change order to cancel themselves.  The reject status on the task is set to automatically cancel the change order.  So I'm not sure how I can put a requirement on the cancelled status of the change order to enter a comment.  That would probably break the automation of cancelling the change order, right?

     

    Maybe I need to instead set up a workflow task message template and apply it to the approval task.  Can it be set up to only send the notification if the approval task is rejected?  If that message template could include information from the change order (change order ticket link and change order description), as well as the task comments of the approval task, then it would tell the customer why the change order was rejected.  Do you think this might be possible to do? 

     

    Thanks,

    Tammy



  • 6.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template
    Best Answer

    Posted May 19, 2016 10:25 PM

    Hi Tammy, here is how I would go about it:

     

    1. Create a new Message Template for Object Type "Change Order Workflow Task" with the message you want to send when the Approval Task is rejected.
    2. Create a Multiple Notification Macro for Object Type "Change Order Workflow Task" referencing the Message Template you just created and update the Objects Contacts list to include "Change Order's End User".
    3. Go to the Change Category, Workflow tab, and view the approval task Template Detail. Click on the Reject Behavior to view it. Click on the "Update Actions on True" and add the Multiple Notification Macro you created in step 2 to the list.


  • 7.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 19, 2016 08:40 PM

    I don't know what I was thinking.. Your original query should be possible. You can query any srel/brel relationship connected to chg object to display on a message template. I think in this case wf is a brel relationship and you would call the first object returned in the brel array. I know Gutis has shown how to build the message template string to show properties connected to a CR. If he is online perhaps he can suggest a solution. If not then I will look into this tomorrow.



  • 8.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 12:00 AM

    Thanks to both Lindsay and Grant... If I can do this from the change order message template that I currently have, I think that would be the best option... So I'll wait to hear from Gutis to see if he has a suggestion for this.

     

    Thanks again!

    Tammy



  • 9.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 01:31 AM

    I would suggest to use Lindsay_Estabrooks solution, since from change you will be able to access only particular tasks in change task array, but approval task  in different workflows may be in different places. For example in one workflow your approval task may be first and in other second, but in message template you must define  exact place in the task array. You may solve this by defining different notification rules for each change category, but in this case Lindsay solution much better.



  • 10.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 05:49 AM

    Hi Gutis,

     

    Ok, even though right now all of the workflow I have has the approval tasks first, I get it that I might want to have one later in the workflow sometime in the future.

     

    So, Lindsey or Gutis:   For the message template, what is the syntax to add the approval task comments?

     

    Thanks,

    Tammy



  • 11.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 06:53 AM

    hi,

    Please note that this is not because approval appear first that this will reflect the order of the data returned because the array element are constructed from the order specified in the schema and is mostly the ID meaning the first one created will be the first one returned.

    I still think that Lindsay_Estabrooks option is the best approach as from the change you may not always return the value you expected for the reason explained above and from Giedrius Bekintis

     

    But for educational purpose below is the syntax that must work to access wf attributes from your change order

     

    @{change_id.workflow.0.comments}

    @{change_id.workflow.0.description}

     

    where 0 represent the first element of the array that have been returned back from the BREL (the first workflow tasks that have been created for this CO)

     

    Hope this help

    /J



  • 12.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 08:45 AM

    Thanks for sharing jmayer. I was thinking it was the other way where the 0 called the last entry in the array.



  • 13.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 10:03 AM

    I'm sorry, maybe I wasn't clear enough.  I intend on trying Lindsay's suggestion, but I still need to know the syntax to include the approval task comment in the new message template for the workflow task that Lindsay said to create (see below). 

     

    1. Create a new Message Template for Object Type "Change Order Workflow Task" with the message you want to send when the Approval Task is rejected.

     

    So, for the workflow task message template, would this syntax work?

     

    Your Change Order has been rejected.

    Requested by: @{chg.requestor.combo_name}

    Description: @{chg.description}

     

    Reason for being rejected:

    @{change_id.workflow.0.comments}

    @{change_id.workflow.0.description}

     

    Click on the following URL to view Change Order:

    @{change_id.web_url}



  • 14.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 10:22 AM

    Your Change Order has been rejected. 

    Requested by: @{chg.requestor.combo_name}

    Description: @{chg.description}

     

    Reason for being rejected:

    @{comments}

    @{description}

     

    Click on the following URL to view Change Order:

    @{chg.web_url}



  • 15.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 21, 2016 10:23 AM

    Thanks, Gutis and Lindsay!  I will try this soon.

     

    Tammy



  • 16.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 20, 2016 10:28 AM

    Hi Tammy,

     

    For a message template for a "Change Order Workflow Task" object everything should be referenced from that object:

    You can see the specific attributes using the command:

    bop_sinfo -d wf

    As I write this I see Gutis' response which has correct syntax.



  • 17.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 21, 2016 11:18 AM

    Well, I must have done something wrong..... But I can't figure out what.  I set up the below, created a new CO with that category, rejected the approval task, and I got all of my normal email notifications, but did not get the new one.  Any ideas?

     

    Thanks.

    Tammy

     

     

    1.  Create a new Message Template for Object Type "Change Order Workflow Task" with the message you want to send when the Approval Task is rejected.

     

    2.  Create a Multiple Notification Macro for Object Type "Change Order Workflow Task" referencing the Message Template you just created and update the Objects Contacts list to include "Change Order's End User".

     


    3.  Go to the Change Category, Workflow tab, and view the approval task Template Detail. Click on the Reject Behavior to view it. Click on the "Update Actions on True" and add the Multiple Notification Macro you created in step 2 to the list.

     

     



  • 18.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 21, 2016 02:23 PM

    Hi Tammy,

     

    I note that in your Multiple Notification Macro you reference Message Template "Change Order Approval Task Rejected" bu the name of your Message Template is "A-Parker Change Order Approval Task Rejected".

     

    Does the "Set CHG Status Cancelled" macro fire?



  • 19.  Re: SDM 14.1 - How to add 'Approval' workflow task comments to 'Abandon/Cancel' CO message template

    Posted May 21, 2016 03:15 PM

    Sorry, Lindsay -- I changed the name to add 'A-Parker' at the beginning after taking screen print #2 and #3, then took screen print #1.   It really shows the 'A-Parker' one.

     

    And now I feel really stupid, because it did work -- I just copied another message template when I created this new one and forgot to change the title, so I thought that email was something else when I received it.  All is good now, thanks everyone!


    Tammy