This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can't get the If statement to work in a notification.

Hello,

I'm trying to have my notification template use an if statement. What am I doing wrong? The code is reading the variable.

This is my test code:

The Platform is :$FIELDVALUE(Platform)

$IF(Platform, M8)

This is an M8 Install.

$ELSE()

This is not an M8 Install.

$ENDIF()

*****************************************************************************************************************************

Output is:

The Platform is:M8

This is not an M8 install.

'************************************************************************************************************************8

The output is incorrect as far as I'm concerned.

Is this something I need to do to make the the if statement work?

Regards,

WIll

Parents
  • 0
    $IF(Platform, M8)

    I'm not familiar with that syntax for the "$IF" tag.  Which version of SBM is that? Can you point me to a user guide??

  • 0 in reply to 

    https://docs.microfocus.com/doc/Solutions_Business_Manager/12.1/ttwa_notification_tags   We are on version 12.1. This is the first time I've attempted the if.

  • 0 in reply to 

    What are the "Platform" and "M8" values??  The "$IF()" tag has a specific set of things it can do.  AFAIK, comparing Fields and values is not one of them, except for the ITEMTYPE field.

  • 0 in reply to 

    Thank you for your help. The platform field has values of "M5" or "M8". Its just a random single selection field. Ok, if your saying it will only work with ITEMTYPE I can live with that. I attempted the same exercise with ITEMTYPE field however I'm confused. Is the "ITEMTYPE" field now "ISSUETYPE"? Do I use the database field name or the Field name? Do I have to rename ISSUETYPE to ITEMTYPE? Or just create an "ITEMTYPE" field? Or, should I use the Field Name or the Database Field name? I've tried both ISSUETYPE database name and the  Item Type field name, both failed to trigger the IF logic.

    My issuetype its named ISSUETYPE in my project.

    Here's my new test code:

    The ISSUETYPE is: $FIELDVALUE(ISSUETYPE)

    $IF(ISSUETYPE, Oracle)

       This is an Oracle issuetype.

    $ELSE()

      This is not an Oracle Issue Type.

    $ENDIF()

    *****************************************************************************************************

    Results:

    The ISSUETYPE is: Oracle

    This is not an Oracle ISSUETYPE.

    *****************************************************************************************

Reply
  • 0 in reply to 

    Thank you for your help. The platform field has values of "M5" or "M8". Its just a random single selection field. Ok, if your saying it will only work with ITEMTYPE I can live with that. I attempted the same exercise with ITEMTYPE field however I'm confused. Is the "ITEMTYPE" field now "ISSUETYPE"? Do I use the database field name or the Field name? Do I have to rename ISSUETYPE to ITEMTYPE? Or just create an "ITEMTYPE" field? Or, should I use the Field Name or the Database Field name? I've tried both ISSUETYPE database name and the  Item Type field name, both failed to trigger the IF logic.

    My issuetype its named ISSUETYPE in my project.

    Here's my new test code:

    The ISSUETYPE is: $FIELDVALUE(ISSUETYPE)

    $IF(ISSUETYPE, Oracle)

       This is an Oracle issuetype.

    $ELSE()

      This is not an Oracle Issue Type.

    $ENDIF()

    *****************************************************************************************************

    Results:

    The ISSUETYPE is: Oracle

    This is not an Oracle ISSUETYPE.

    *****************************************************************************************

Children
  • 0 in reply to 

    Yes, "ITEMTYPE" is the TS_ISSUETYPE aka "Item Type" field.  That particular incantation of the "$IF()" might require "ITEMTYPE". Confusing, huh?

    For the notification tags, copy anything in UPPERCASE as-is in the docs.  Lower case params represent data or field names from the associated table.

    $IF(CANVIEW, fieldname)

    $IF(ITEMTYPE, value or prefix from TS_ISSUETYPE aka "Item Type" field)

    $IF(VIEWLINK)

    I think you might need to move the "Platform is M5 or M8" tests and decision making to M5 and M8 specific Notifications & Notifications Rules, then for each Notifications create a template.  Like an "M5" template and an "M8" template.