How to transform/Generate dinamic values when Creating Account?

Problem

I`m new to ISC and i`m trying to dinamically send the date that an account is created (Create Account/Provisioning Policy of the source) on an integrated system, trying to achieve this without using cloud rules, only static values or simple velocity scripts or transforms, how can this be achieved and is it possible?

The format has to be yyyy-MM-dd

I have tried alternatives using the static option on the form and the scripts below, but they don’t seem to work.

$currentDate.toString()

#set($date = ${"java.util.Date"}.class.newInstance())

$date



$created

Thank you.

Hi @mtavan,

You can achieve this using transforms.
First get the date using “now” keyword, then change the format as requred.

Date Math | SailPoint Developer Community
Date Format | SailPoint Developer Community

Hi @mtavan

I would suggest to create a new identity attribute to store this identity attribute. That will allow you to enable attribute sync for this attribute as well.

You can also achieve it using transforms in create/update provisioning policy by changing the date format to YYYY-MM-DD while provisioning, but then this means that this provisioning policy will trigger every time even when some other attribute is being updated and will lead to too many unwanted events.

So in my view creating an identity attribute should do the trick, if not then you can choose to create a transform in Create provisioning policy and there you can change the date format to desired format.

I hope this helps.

Regards

Vikas.

What you’re trying with Static and Velocity won’t work for current date generation in ISC.
In provisioning policies, the Velocity context is very limited:

  • No dateTool
  • No java.util.Date instantiation
  • No built-in $currentDate
  • $created isn’t available unless explicitly passed

So all those attempts will silently fail or return empty.

You can use a transformer like this

{
  "name": "Current_Date_yyyy_MM_dd",
  "type": "dateFormat",
  "attributes": {
    "inputFormat": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
    "outputFormat": "yyyy-MM-dd",
    "input": {
      "type": "dateMath",
      "attributes": {
        "expression": "now"
      }
    }
  }
}

Attach this transform to your attribute in the Create Account provisioning policy

This will also do the same thing:

                        {
                            "attributes": {
                                "dateOffset": "0",
                                "input": {
                                    "type": "trim"
                                },
                                "inputFormat": "M/d/yyyy",
                                "name": "Cloud Services Deployment Utility",
                                "operation": "getDate",
                                "outputFormat": "yyyy-MM-dd",
                                "referenceDate": "now"
                            },
                            "type": "rule"
                        }

We use this to add data to the ‘comments’ field on AD account enable/disablement

@mtavan you can refer to below sample and remove the unwanted things present .In this we are using an transform at the account level

typ {
            "name": "User Valid To",
            "transform": {
                "type": "dateFormat",
                "attributes": {
                    "inputFormat": "ISO8601",
                    "outputFormat": "yyyy-MM-dd",
                    "input": {
                        "type": "dateMath",
                        "attributes": {
                            "expression": "+3y",
                            "roundUp": true,
                            "input": {
                                "type": "dateFormat",
                                "attributes": {
                                    "inputFormat": "yyyy-MM-dd",
                                    "outputFormat": "ISO8601",
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "sourceName": "Non-Employee",
                                            "attributeName": "Start Date"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }e or paste code here

Thanks for the good answers, i was able to solve it using the logic provided here.