DateMath Transform not returning values

Hello,

I am trying to create a transform with a straightforward requirement: whenever a certain entitlement is assigned to a user, the assignment date should be captured in IdentityAttribute. I used accountattributefilter to check if the user has the membership, and that part is working fine. Now, I need to compare the existing value to see if it is in the past. If it is, it needs to be retained. I tried using DateMath transform, but instead of returning the value, I get the following output:

"{attributes=com.sailpoint.seaspray.transform.DateCompare@34d89c5a}"

Is this the expected behavior?.

My transformation code is

{
      "name": "Calculate ServiceNow Group Assignment Date",
    "type": "lookup",
    "attributes": {
        "input": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "accountPropertyFilter": "groups.contains(\"<groupId>\")",
                            "attributeName": "groups",
                            "sourceName": "ServiceNow"
                        },
                        "type": "accountAttribute"
                    },
                    "FALSE"
                ]
            },
            "type": "firstValid"
        },
        "table": {
            "FALSE": "",
            "default": {
                "attributes": {
                    "firstDate": {
                        "attributes": {
                            "value": "servicenowGroupAssignmentDate"
                        },
                        "type": "identityAttribute"
                    },
                    "secondDate": "now",
                    "operator": "gt",
                    "positiveCondition": {
                        "attributes": {
                            "value": "servicenowGroupAssignmentDate"
                        },
                        "type": "identityAttribute"
                    },
                    "negativeCondition": {
                        "attributes": {
                            "expression": "now",
                            "roundUp": false
                        },
                        "type": "dateMath"
                    },
                    "type": "dateCompare"
                }
            }
        }
    },
    "internal": false
}

@krunal_sshah first convert the input date to ISO format then it should work

1 Like

Thanks @schattopadhy , In addition to your inputs, we realized that there was one more error, which rendered one of the values null.

{
                        "attributes": {
                            "value": "servicenowGroupAssignmentDate"
                        },
                        "type": "identityAttribute"
                    }

we updated it to

{
                        "attributes": {
                            "name": "servicenowGroupAssignmentDate"
                        },
                        "type": "identityAttribute"
                    }

and the solution worked. Thank you for the help.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.