CA Service Management

Expand all | Collapse all

parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

Giedrius Bekintis

Giedrius BekintisAug 13, 2015 09:56 AM

  • 1.  parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 12, 2015 06:50 AM

    Hi all, We have to configure the parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed. kindly help us out with an idea.



  • 2.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Broadcom Employee
    Posted Aug 12, 2015 03:22 PM

    I think one way to do this is thru a custom trigger on mdb table call_req

    such that for update operation if the status=CL check all records whose

    "parent" field has the persid(something like cr:xxxxxxx) of the record and has status<>CL, then this update will be rejected with some  message returned to the calling agent.

    If you want to do it on SDM side, some custom trigger on cr/in/pr object

    would be needed to trigger on status=CL and the spel code perform the same/similar logic as DB trigger.



  • 3.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 12:48 AM

    Hi Chi Chen,

     

    Thanks for your  prompt responses.

     

    But i don't have much experience in this kind of customization. If you

    don't mind can you Pl. share the full work around to achieve this.

    It will be very helpful for  us. Looking forward to your positive reply.

     

    Regards,

    AKHIL RAJ R



  • 4.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 12, 2015 04:33 PM
      |   view attached

    You can also use status transition but for that you will need condition macro like this:

     

    example for the change

    string wc;
    int active_count;
    wc = format("parent = %s AND status != 'CL'", id);
    send_wait(0, top_object(), "call_attr", "chg", "sync_fetch", "MLIST_STATIC", wc, -1,0);
    active_count = msg[1];
    logf(SIGNIFICANT,"%s",active_count);
    if (active_count > 0) {
    set_return_data(FALSE);
    }else
    {
    set_return_data(TRUE);
    }
    
    

     

     

    for cr it should look similar to this:

    string wc;
    int active_count;
    wc = format("parent = '%s' AND status != 'CL'", persistent_id);
    send_wait(0, top_object(), "call_attr", "cr", "sync_fetch", "MLIST_STATIC", wc, -1,0);
    active_count = msg[1];
    logf(SIGNIFICANT,"%s",active_count);
    if (active_count > 0) {
    set_return_data(FALSE);
    }else
    {
    set_return_data(TRUE);
    }
    
    

     

    as you see for cr in where clause you need to use persistent id and specify cr instead of chg for send_wait call

     

    I have attached macro for change case. You can load it by using the following command:

     

    pdm_load -i -m -f check_for_active_childs.macro

    Attachment(s)



  • 5.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed
    Best Answer

    Posted Aug 13, 2015 01:02 AM

    Hi Gutis,

     

    Thanks for your quick responses.

     

     

    Correct me if  i am wrong for  incidents i want to restructure it as

    follows right?

     

    string wc;

    int active_count;

    wc = format("parent = %s AND status != 'CL'", persistent_id);

    send_wait(0, top_object(), "call_attr", "in", "sync_fetch",

    "MLIST_STATIC", wc, -1,0);

    active_count = msg[1];

    logf(SIGNIFICANT,"%s",active_count);

    if (active_count > 0) {

    set_return_data(FALSE);

    }else

    {

    set_return_data(TRUE);

    }

     

     

    After uploading this macro do i want to  change any settings at  SDM

    interface .

    If you don't mind  it will be very helpful if you could  guide me those

    procedure also if any .

     

     

    Thanks in advance

    Regards,

    AKHIL RAJ R



  • 6.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 01:21 AM
      |   view attached

    I have attached request macro for you all you need to do is to define it in all status transitions that leads to closed status e.g.

    Attachment(s)



  • 7.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 08:50 AM
      |   view attached

    Hi Gutis,

     

    We are trying to load the macro file as you had explained in earlier mail.

     

    At that time we are getting an error as shown in attached screen shot.

     

     

     

    I have attached the macro file as well. It will very helpful for me if you

    could review and let me know if any modifications are required.

     

     

     

     

     

    Regards,

    AKHIL RAJ R

    CA Team

    Data Center

    Bank of Maharashtra, Pune

    Attachment(s)



  • 8.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 08:57 AM

    Why did you decided to change macro? Just load macro I provided for You in check_for_active_childs_cr.macro . It should be properly escaped and encoded as provided in my file.



  • 9.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 09:10 AM

    We are still getting the same error.

     

     

     

     

    Regards,

    AKHIL RAJ R

    CA Team

    Data Center

    Bank of Maharashtra, Pune



  • 10.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 13, 2015 09:56 AM

    could you post the error?



  • 11.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Broadcom Employee
    Posted Aug 19, 2015 03:01 PM

    Thank you for the responses so far on this matter, specially Gutis and Chi.

     

    Akhil,

    Is this still an issue, would you be able to post the error that Gutis was requesting earlier?

     

    Thx

    _R



  • 12.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 12:05 AM

    Hi Raghu,

     

    This is Sailee, posting on behalf of AKHIL.

     

    We did all the steps exactly like posted by Gutis but the problem we were

    facing is still there.

     

    We tried by creating 2 test incidents one of which is parent. Both are

    with status "open".

     

    After creating the incident transition from status "Open" to Status

    "Close" we were able to see only one status "Close" in status drop down

    and the parent ticket is getting closed even though the child ticket is

    open.

     

     

    Regards,

    Sailee Dale

    CA Team

    Data Center

    Bank of Maharashtra, Pune



  • 13.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 12:41 AM

    After configuring the status transition correctly to invoke the condition macro, you should see this (assuming you did not add a 'Condition Error Message' to the transition):

    StatTranFail_01.PNG

    Does your status transition look like this?

    StatTranDefn_01.PNG

    Note that you have to define transitions separately for Requests, Incidents and Problems.  The fact that you are only seeing one candidate status (Closed) suggests that you have defined the transition, but perhaps it is not yet associated with the macro.  Having defined one status transition you will also have to define every other permitted transition - and associate this macro with every transition to 'Closed'.



  • 14.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 02:31 AM

    Hi,

     

    Its now working. It is showing error message while closing the parent

    ticket if child is active.

     

    But it is showing the same error at the time of closing the child ticket.

    It is not allowing to close the child ticket.

     

     

    Regards,

    Sailee Dale

    CA Team

    Data Center

    Bank of Maharashtra, Pune



  • 15.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 03:06 AM

    Maybe your child is parent for another ticket



  • 16.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 03:16 AM

    Hi Guits,

     

    We have cross checked for the possibility. But there are no active

    children for that ticket.

     

     

    Regards,

    Sailee Dale

    CA Team

    Data Center

    Bank of Maharashtra, Pune



  • 17.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 03:22 AM

    Try to perform status change once again and look for the errors in stdlog, Stdlog should contain an ERROR if there is an error when evaluating macro or SIGNIFICANT message with count of the children. Could you please also post screenshot of your condition macro



  • 18.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 03:49 AM

    Hi,

     

    We checked for the stdlog , it contains ERROR as :

     

     

     

    Screen shot of condition macro:

     

     

     

    Screen shot of Incident Transition.

     

     

     

     

    Regards,

    Sailee Dale

    CA Team

    Data Center

    Bank of Maharashtra, Pune



  • 19.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 03:51 AM

    There is no screenshots in your post



  • 20.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:03 AM


  • 21.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:10 AM

    It is still empty. Maybe you using email for the updates? Please try to use an web interface



  • 22.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:24 AM

    stdlog error:

    stdlog_error.PNG

    Screen shot of condition macro:

    Condition-macro.PNG

     

     

    Screen shot of Incident Transition.

    Status Transition.PNG



  • 23.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:27 AM

    Do you use it for incidents or changes

     

    Sent from my iPhone



  • 24.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:43 AM

    Try using persistent_id rather than id and ‘%s’ rather than plain %s in the where clause.  I presume ‘INCLS’ is your own code for something like ‘incident closed’?

     

    wc = format("parent = '%s' AND status != 'INCLS'", persistent_id);



  • 25.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 04:48 AM

    The object type of the macro is invalid if you use it for incidents. Please load macro that i attached for requests

     

    Sent from my iPhone



  • 26.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 05:37 AM

    Hi Gutis,

    Now it is working as expected.

    Thanks a lot for all the help and replying for each of our doubts patiently.



  • 27.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 05:38 AM

    You are welcome



  • 28.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 05:38 AM

    Hi James,

     

    Now its working as expected.

    Thanks a lot for all the help and guiding us.



  • 29.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed

    Posted Aug 20, 2015 05:41 AM

    No worries ☺



  • 30.  Re: parent child relation ship such a way that the parent ticket not to be closed untill all the childern tickets are closed