CA Service Management

Expand all | Collapse all

Change Status of Request when Task Approved

  • 1.  Change Status of Request when Task Approved

    Posted Jun 08, 2016 05:28 PM


    Hello Guys,

     

    We applied the Commulative Patch on our  SDM 14.1 environment so we can manage classic workflow on Incidents and Request.

     

    Now we have a requierement from users where they want that if a task is set to "Approved" then the status of the Ticket is changed from "Open" to another status.

     

    Any idea on how could we achieve this?

     

    Regards,



  • 2.  Re: Change Status of Request when Task Approved
    Best Answer

    Posted Jun 08, 2016 07:17 PM
    1. Create an Action Macro (note that this cannot be done using the web interface) for Object Type "Request/Incident/Problem Workflow Task". The Macro Code would be: cr.status = 'appropriate status code';
    2. Go to the Request/Incident/Problem Area with the workflow. View the task definition. View the 'Approve' behavior.
    3. Click on Update Actions on True. Select Type 'Action'. Click Search.
    4. Move your Macro (created in step 1) from the Possible Actions list to the Actions on True list and click OK.

     

    Since the web interface will not allow you to create Action macros you will have to pdm_extract an existing Action Macro to a file, modify it with a text editor (including a new id and persid), and pdm_userload the result.

     

    As always with SPEL code, be careful and test well.



  • 3.  Re: Change Status of Request when Task Approved

    Posted Mar 28, 2019 07:38 AM

    hi Lindsay_Estabrooks 

    ive a scenario .if we change the ticket  status to approved then automatically a group will get attached in the ticket.

    what spell macro should we use to achieve this?

    Do you have any suggestions?



  • 4.  Re: Change Status of Request when Task Approved

    Posted Mar 28, 2019 02:58 PM

    Assuming you are following the answer I provided above, adding this to your macro might work:

    cr.group = (uuid)"uuid of group contact";



  • 5.  Re: Change Status of Request when Task Approved

    Posted Apr 02, 2019 03:58 AM

    thanks Lindsay_Estabrooks .Its working with wf but what if i want to achieve this scenario without using wf.



  • 6.  Re: Change Status of Request when Task Approved

    Posted Apr 02, 2019 01:55 PM

    Assuming that you want to change the group to a specific value whenever the Request/Incident/Problem status is change to approved. I recommend creating a mod file with a trigger and then a spl file with SPEL code that will update the ticket group. There are lots of examples in the community from which you can get ideas for your SPEL coding.



  • 7.  Re: Change Status of Request when Task Approved

    Posted Jun 09, 2016 07:26 AM

    You also can use this code for the Action macro

     

    misc::change_ticket_status(this.cr, group_leader, attached_event, event_tmpl, ''appropriate status code");



  • 8.  Re: Change Status of Request when Task Approved

    Posted Jun 22, 2018 01:26 PM

    Hi Gutis, I have this error using that macro:

    06/22 13:24:42.49 Graziani spelsrvr 7028 ERROR pcexec.c 6403 Spell interp failed at misc.spl:misc::change_ticket_status | Establece Estado del Ticket = Resuelto al completar Tarea:1:: Arg 0 of type STRING: expected tkt_dob of type OBJECT



  • 9.  Re: Change Status of Request when Task Approved

     
    Posted Jun 14, 2016 05:13 PM

    Hi JeanFranco - Did any of the responses help answer your question? If so please mark as Correct Answer. Thanks!



  • 10.  Re: Change Status of Request when Task Approved

    Posted Aug 08, 2018 06:23 AM

    Hello All,

    I used both the code and both of it is throwing error:

     

    cr.status = 'appropriate status code';

     

    is giving error Spell interp failed at Action Macro name:1:: set_attr on cr.status failed: AHD03025:Attempt to modify non_CO value

     

    misc::change_ticket_status(this.cr, group_leader, attached_event, event_tmpl, ''appropriate status code");

     

    this giving error as already mentioned in the previous posts:

     

    Spell interp failed at misc.spl:misc::change_ticket_status | Action Macro name:1:: Arg 0 of type STRING: expected tkt_dob of type OBJECT

     

    Please any one knows what will be the right code?

     

    Thanks in Advance.