CA Service Management

Expand all | Collapse all

Modify date - Knowledge document

Jump to Best Answer
  • 1.  Modify date - Knowledge document

    Posted 08-07-2018 04:07 PM

    Hi guys,

     

    How can I create a site-condition that compares the MODIFY_DATE to be greater than 1 year?

    By default, I can create a condition to compare with other date, not to a pre-defined period.

     

    Any ideas?

     



  • 2.  Re: Modify date - Knowledge document
    Best Answer

    Posted 08-07-2018 06:46 PM

    You will have to create a condition macro (not site-defined condition). This will be coded in SPEL. The now() function will come in handy. Take a look at this for ideas:CA SDM::.SPEL::. Now



  • 3.  Re: Modify date - Knowledge document

    Posted 08-08-2018 12:58 PM

    Thanks for your help Lindsay..

    Do you have any example of the SPEL code that does something like this?

     

    Thank you again.



  • 4.  Re: Modify date - Knowledge document

    Posted 08-08-2018 02:02 PM

    hi,

    date converting examples could be found here: CA Service Desk date function in spell code 

    in your situation try this one:

    date znow;
    znow = now();
    if ((int)MODIFY_DATE >= (int)((int)znow - (365 * 24 * 3600))) {
    set_return_data(TRUE);
    } else {
    set_return_data(FALSE);
    }

    Regards.