Compare Timestamps Workflow Issue

I am having an issue comparing two dates. Both dates are in the proper ISO format- at least I think it is.

In my manual workflow test the comparison is to test to see if:
2023-12-12T00:00:00.000Z
Is On Or Before
2024-01-03T18:55:37.937Z

It keeps evaluating to false.

Workflow attached.
MatttestCompareTimestamp20240103.json (1.4 KB)

Here is the Step Input from the Compare Timestamp Operator when testing:

{
  "defineVariable": {
    "now": "2024-01-03T18:55:37.937Z"
  },
  "trigger": {
    "changes": [
      {
        "attribute": "endDate",
        "newValue": "2023-12-12T00:00:00.000Z",
        "oldValue": ""
      }

Hello Matt,

I looked at your workflow and saw that you are missing one action. After you have trigger “Identity Attributes Changed”, you have to fetch that particular identity. So you need another action “Get Identity” before doing any comparison in identity attribute. Also, you can just select the variable from open variable selector after fetching identity. I see you are using script but it is of no need. You can simply select attribute “endDate” from the open variable selector in your Compare Timestamps operator because you don’t have to mention to use newValue as the attribute comes with newValue after trigger. Hope that helps.

For manual workflow testing, I am doing it this way. For the “real” workflow, I would of course use Get Identity. I am just trying to compare two timestamps quick and dirty without having to modify any identity.

For manual workflow testing as well, the identity won’t get modified. You can leverage the “identity attributes changed” json and put any test id value to that json and use it to test it. Triggers - SailPoint Identity Services
Change the id to any test id or your id as well, to check if it is working as intended. The only thing you need to change in that JSON to do the testing is the id value. You don’t have to modify anything as “get Identity” will fetch id value and fetch endDate attribute of that id.

This is exactly what I have been doing from the start. I probably forgot to post the input I was using to test with.

{
  "identity": {
    "id": "16a779def5b94b0ba95576d7bf305095",
    "name": "alan.bradley",
    "type": "IDENTITY"
  },
  "changes": [
    {
      "attribute": "endDate",
      "oldValue": "",
      "newValue": "2023-12-12T00:00:00.000Z"
    }
  ]
}

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

Hey Matt.

The issue is that your “Value 2” in the compare step is set to “Enter Value”. This is where you insert text or inline variables.

To reference your defined variable in “Value 2”, you need to change the input type to “Choose Variable”.

Once you make the change, your workflow will work correctly.