CA Service Management

 View Only
  • 1.  How to make attachment mandatory for Tickets

    Posted Jan 18, 2015 12:03 AM

    Hi all,

     

    SD 12.9

    how to make the attachments required for tickets in ServiceDesk.

     

    Thanks,

    Venkat.



  • 2.  Re: How to make attachment mandatory for Tickets

    Posted Feb 27, 2015 12:43 PM

    Does anyone have an answer for Venkat?

     

    How to make attachment mandatory for Tickets

    This question is Not Answered.(Mark as assumed answered)

    v venkateswarluParticipant

    Hi all,

     

    SD 12.9

    how to make the attachments required for tickets in ServiceDesk.

     

    Thanks,

    Venkat.



  • 3.  Re: How to make attachment mandatory for Tickets

    Broadcom Employee
    Posted Feb 27, 2015 01:26 PM

    I am not aware of any mechanism to make attachments required OOTB.

     

    This might be achievable via customizations.



  • 4.  Re: How to make attachment mandatory for Tickets

    Posted Mar 02, 2015 08:58 PM

    This is very similar to the problem 'how to make an affected CI mandatory for a change order', and my approach would be the same in either case.  For attachments, add a POST_VALIDATE trigger in site\mods\majic, calling a spel function that gets 'attachments.length' for the ticket and sets an appropriate error message if attachments.length <= 0.  Alternatively, if you have a status transition that you can tie this requirement to, then hand-code a site-defined condition macro that tests 'attachments.length' and use that in the status transition.

     

    Regards,

    James



  • 5.  RE: Re: How to make attachment mandatory for Tickets

    Posted Feb 14, 2020 08:24 AM
    Can you please be more detail or set some example.


  • 6.  RE: Re: How to make attachment mandatory for Tickets

    Broadcom Employee
    Posted Feb 17, 2020 05:10 AM
    Perhaps you can use this sample code as the base?

    http://forum.servicedeskusers.com/forums/topic/22998-attachment-required-for-some-request-area/?tab=comments#comment-52878

    You'd need to twig the spel-code to remove if statement in the beginning and probably alter the error message appropriately.

    ------------------------------
    Kind Regards,
    Brian
    ------------------------------



  • 7.  RE: Re: How to make attachment mandatory for Tickets

    Posted Feb 18, 2020 02:37 AM
    I've tried that but it is blocking wether is attachment attached or not. I guess attachment lenght is always 0.


  • 8.  RE: Re: How to make attachment mandatory for Tickets

    Posted Feb 18, 2020 03:06 AM
    I even tried following and got the same result:


    cr::zcr_verify_attach(...){


    string zmsg;

    int zaccesstype, zattmnt_length;

    uuid someuser;


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

    someuser = msg[0];


    logf(SIGNIFICANT, "someuser = %s", someuser);


    send_wait(0, top_object(), "call_attr", "cnt", "sync_fetch", "STATIC", format("id = U'%s'", someuser), -1, 0);

    object lstUser, objUser;

    lstUser = msg[0];

    send_wait(0, lstUser, "dob_by_index", "DEFAULT", 0,0);

    objUser = msg[0];

    zaccesstype = objUser.access_type;


    logf(SIGNIFICANT, "zaccesstype = %d", zaccesstype);


    if (zaccesstype == 10002 || is_null(zaccesstype))

    {

    send_wait( 0, this, "get_attr_vals",1,"attachments.length");


    if (msg_error()) {

    logf(ERROR, "error getting attachments.length for %s %s - %s", type, ref_num, msg[0]);

    return;

    }


    zattmnt_length = msg[3];


    if (zattmnt_length == 0) {

    zmsg=format("You must provide an 'Attachment' in order to create new %s.", type.sym);

    set_error(1);

    set_return_data(zmsg);

    }

    }


    }


  • 9.  RE: Re: How to make attachment mandatory for Tickets

    Broadcom Employee
    Posted Feb 18, 2020 04:50 AM
    Hi Davor,

    When you evaluate the attachments.length field for a ticket that has an attachment vs. one that does not have an attachment, is the value the same?

    Just trying to understand why it does not work for all cases...

    ------------------------------
    Kind Regards,
    Brian
    ------------------------------



  • 10.  RE: Re: How to make attachment mandatory for Tickets

    Posted Feb 18, 2020 05:17 AM
    Yes, I've printed the value of zattmnt_length in log and it is always 0.

    02/18 09:32:57.32 sbg01ca17-app- spelsrvr 176 SIGNIFICANT zcr_verify_attach.sp 9 someuser = 33090F89CB051B4B8DAEECEAA27E798C
    02/18 09:32:57.33 sbg01ca17-app- spelsrvr 176 SIGNIFICANT zcr_verify_attach.sp 18 zaccesstype = 10002
    02/18 09:32:57.33 sbg01ca17-app- spelsrvr 176 SIGNIFICANT zcr_verify_attach.sp 36 zattmnt_length = 0
    02/18 09:32:57.35 sbg01ca17-app- web:local 3056 ERROR freeaccess.spl 25902 create checkin of cr:773255 failed: You must provide an 'Attachment' in order to create new Incident.