Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Service now locked state and valid through are not populating in user account

PiyushRai
New Contributor
New Contributor

Hi All,

Upon trying to populate the valid through and locked state we are seeing its not working but when mapping the attributes with custom property we see the values being populated.

{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"statusColumn": "customproperty10",
"activeStatus": [
"true"
],
"deleteLinks": false,
"accountThresholdValue": 1000,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": false
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "xyz.abc.com",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpMethod": "GET"
},
"listField": "Resources",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"status": "active~#~char",
"name": "userName~#~char",
"displayname": "displayName~#~char",
"customproperty15": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char",

"VALIDTHROUGH": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate~#~datetime,
"customproperty2": "name.givenName~#~char",
"customproperty3": "name.familyName~#~char",
"customproperty4": "emails[0].value~#~char",
"customproperty5": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.manager.displayName~#~char",
"customproperty7": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.location.name~#~char",
"customproperty10": "active~#~char"
},
"statusAndThresholdConfig": {
"lockedstateColumn": "customproperty15",
"true":"locked",
"false":"unlocked"
},
"pagination": {
"offset": {
"offsetParam": "startIndex",
"batchParam": "count",
"batchSize": 10,
"totalCountPath": "completeResponseMap.totalResults"
}
}
}
}
}
}

29 REPLIES 29

rushikeshvartak
All-Star
All-Star

lockedstate needs to be added in mapping and validthrough needs to be lower case


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh,

As mentioned above we tried mapping lockedstate but it didn't populate also lower case also didn't work for validthrough

Share the josn


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

PiyushRai
New Contributor
New Contributor

{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"statusColumn": "customproperty10",
"activeStatus": [
"true"
],
"deleteLinks": false,
"accountThresholdValue": 1000,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": false
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "xyz.abc.com",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpMethod": "GET"
},
"listField": "Resources",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"status": "active~#~char",
"name": "userName~#~char",
"displayname": "displayName~#~char",
"lockedstate": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char",

"validthrough": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate~#~datetime,
"customproperty2": "name.givenName~#~char",
"customproperty3": "name.familyName~#~char",
"customproperty4": "emails[0].value~#~char",
"customproperty5": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.manager.displayName~#~char",
"customproperty7": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.location.name~#~char",
"customproperty10": "active~#~char"
},
"pagination": {
"offset": {
"offsetParam": "startIndex",
"batchParam": "count",
"batchSize": 10,
"totalCountPath": "completeResponseMap.totalResults"
}
}
}
}
}
}

Share postman response 

Does cp2/3 is populated 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Yes cp 2 and 3 are populated here is an api response

            "userName""jimmie.xxxxxxxxxx",

            "name": {

                "familyName""xxxxxxxxx",

                "givenName""Jimmie"

            },

            "displayName""Jimmie xxxxxxxxx",

            "active"true,

            "emails": [

                {

                    "value""jimmie.xxxxxxxxxx@example.com",

                    "type""work"

                }

            ],

            "urn:ietf:params:scim:schemas:extension:servicenow:2.0:User": {

                "gender""Male",

                "costCenter": {

                    "value""91e8bbf43710200044e0bfc8bcbe5daa",

                    "name""Customer Support",

                    "$ref""https:// 

                },

                "department": {

                    "value""5d7f17f03710200044e0bfc8bcbe5d43",

                    "name""Customer Support",

                    "$ref""https://" 

                },

                "manager": {

                    "value""06826bf03710200044e0bfc8bcbe5d81",

                    "displayName""Justina xxxxxx",

                    "$ref""https://" 

                }

            },

            "urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:User": {

                "endDate""1970-01-01T00:00:00Z",

                "lockedOut"false

            }

        }
[This message has been edited by moderator to disable hyperlink to an URL]

Hi Rushikesh,
We have populated the lockedstate now but validthrough is still not populated when we try to populate it in cp we see the result,

"customproperty11": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate~#~char",

Ok below worked 

urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai - Try to add the following to your JSON

 

"globalSettings": {
"dateFormat": "yyyy-MM-ddTHH:mm:ssZ"
},

Refer - Sample ImportAccountEntJSON: 

https://docs.saviyntcloud.com/bundle/KBAs/page/Content/Declaring-passwords-or-user-defined-attribute...


Thanks
Rajesh Ramalingam
Saviynt India

Hi Rajesh,

It didn't work, when we try to populate cp we see the expected result populated

"customproperty11": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate~#~char",

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai 

This will work as this is a character, but your data is not a well formatted date.

you can use CONST and transform the string and try importing.

"validthrough": "#CONST#${dateString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; returnString=Date.parse("yyyy-MM-ddTHH:mm:ssZ",dateString); return returnString;}~#~date",

 


Thanks
Rajesh Ramalingam
Saviynt India

Hi @Rajesh-R 

This didn't work the customproperty i mapped with earlier is still populated and not validthrough?

Can this be because not properly formatted data?

Rajesh-R
Saviynt Employee
Saviynt Employee

Can you share the logs for this last run?

also enable {"showLogs":true}


Thanks
Rajesh Ramalingam
Saviynt India

You have set data type as datetime instead of date

 

"ecm-worker","2023-12-12T10:42:07.993+00:00","{"log":"                    \"validthrough\": \"#CONST#${dateString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; returnString=Date.parse('yyyy-MM-ddTHH:mm:ssZ',dateString); return returnString;}~#~datetime\",\r\n","stream":"stdout","time":"2023-12-12T10:42:07.03386072Z"}"

 

 

Set below

"validthrough": "#CONST#${dateString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; returnString=Date.parse("yyyy-MM-ddTHH:mm:ssZ",dateString); return returnString;}~#~date",

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@rushikeshvartak 

Did try it with datatype date as well but didn't work here is the logs for the same.

Rajesh-R
Saviynt Employee
Saviynt Employee

Try the following one:

"validthrough": "#CONST#${dateString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; returnString=Date.parse("yyyy-MM-dd'T'HH:mm:ss'Z'",dateString); return returnString;}~#~date",

Thanks
Rajesh Ramalingam
Saviynt India

PiyushRai
New Contributor
New Contributor

@Rajesh-R 

It shows a syntax error here 

"yyyy-MM-dd'T'HH:mm:ss'Z'"

 this is the json 

{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"statusColumn": "customproperty10",
"activeStatus": [
"true"
],
"deleteLinks": false,
"accountThresholdValue": 1000,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": false,
"lockedStatusColumn": "customproperty15",
"lockedStatusMapping": {
"Locked": [
"true"
],
"Unlocked": [
"false"
]
}
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xyz.com",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpMethod": "GET"
},
"listField": "Resources",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"status": "active~#~char",
"name": "userName~#~char",
"displayname": "displayName~#~char",
"validthrough": "#CONST#${dateString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; returnString=Date.parse(("yyyy-MM-dd'T'HH:mm:ss'Z'"),dateString); return returnString;}~#~date",
"customproperty15": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char",
"customproperty2": "name.givenName~#~char",
"customproperty3": "name.familyName~#~char",
"customproperty4": "emails[0].value~#~char",
"customproperty5": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.manager.displayName~#~char",
"customproperty7": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.location.name~#~char",
"customproperty10": "active~#~char"
},
"pagination": {
"offset": {
"offsetParam": "startIndex",
"batchParam": "count",
"batchSize": 10,
"totalCountPath": "completeResponseMap.totalResults"
}
}
}
}
}
}

Rajesh-R
Saviynt Employee
Saviynt Employee

Please try the below:

"validthrough": "#CONST#${responseString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; dateString = responseString.replaceAll('T',' ').replaceAll('Z','');returnString=Date.parse(('yyyy-MM-dd HH:mm:ss'),dateString); return returnString;}~#~date",

Thanks
Rajesh Ramalingam
Saviynt India

@Rajesh-R 

Validthrough didn't populate with the above code either.

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai  - Please use the following and confirm

{
  "globalSettings": {
    "dateFormat": "yyyy-MM-dd'T'HH:mm:ss"
  },
  "accountParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "statusColumn": "customproperty10",
      "activeStatus": [
        "true"
      ],
      "deleteLinks": false,
      "accountThresholdValue": 1000,
      "correlateInactiveAccounts": true,
      "inactivateAccountsNotInFile": false
      }
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "url": "https://xyz.com",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpMethod": "GET"
        },
        "listField": "Resources",
        "keyField": "accountID",
        "statusConfig": {
          "active": "true",
          "inactive": "false"
        },
        "colsToPropsMap": {
          "accountID": "id~#~char",
          "status": "active~#~char",
          "name": "userName~#~char",
          "displayname": "displayName~#~char",
          "validthrough": "#CONST#${responseString = response.urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate; dateString = responseString.replaceAll('Z',''); return dateString;}~#~date",
          "customproperty15": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char",
          "customproperty2": "name.givenName~#~char",
          "customproperty3": "name.familyName~#~char",
          "customproperty4": "emails[0].value~#~char",
          "customproperty5": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.manager.displayName~#~char",
          "customproperty7": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.location.name~#~char",
          "customproperty10": "active~#~char"
        },
        "pagination": {
          "offset": {
            "offsetParam": "startIndex",
            "batchParam": "count",
            "batchSize": 10,
            "totalCountPath": "completeResponseMap.totalResults"
          }
        }
      }
    }
}

 


Thanks
Rajesh Ramalingam
Saviynt India

@Rajesh-R  Hi Rajesh,
This code made all the accounts in endpoint in suspended from importing service.

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai  - Could you share the complete logs?


Thanks
Rajesh Ramalingam
Saviynt India

@Rajesh-R 

Attaching the logs

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai - The latest attachment doesn't look like import logs.


Thanks
Rajesh Ramalingam
Saviynt India

@Rajesh-R - Apologies here are the correct import logs

Rajesh-R
Saviynt Employee
Saviynt Employee

@PiyushRai  Please try with the following:

{
  "globalSettings": {
    "dateFormat": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
  },
  "accountParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "statusColumn": "customproperty10",
      "activeStatus": [
        "true"
      ],
      "deleteLinks": false,
      "accountThresholdValue": 100,
      "correlateInactiveAccounts": true,
      "inactivateAccountsNotInFile": false
      }
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "url": "https://xyz.com",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpMethod": "GET"
        },
        "listField": "Resources",
        "keyField": "accountID",
        "statusConfig": {
          "active": "true",
          "inactive": "false"
        },
        "colsToPropsMap": {
          "accountID": "id~#~char",
          "status": "active~#~char",
          "name": "userName~#~char",
          "displayname": "displayName~#~char",
          "VALIDTHROUGH": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.endDate~#~date",
          "customproperty15": "urn:ietf:params:scim:schemas:extension:servicenow:custom:2~dot#0:User.lockedOut~#~char",
          "customproperty2": "name.givenName~#~char",
          "customproperty3": "name.familyName~#~char",
          "customproperty4": "emails[0].value~#~char",
          "customproperty5": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.manager.displayName~#~char",
          "customproperty7": "urn:ietf:params:scim:schemas:extension:servicenow:2~dot#0:User.location.name~#~char",
          "customproperty10": "active~#~char"
        },
        "pagination": {
          "offset": {
            "offsetParam": "startIndex",
            "batchParam": "count",
            "batchSize": 10,
            "totalCountPath": "completeResponseMap.totalResults"
          }
        }
      }
    }
}

Thanks
Rajesh Ramalingam
Saviynt India

@Rajesh-R  this didn't work either like last time it made all the accounts in endpoint in suspended from importing service. I wanted to thank you for your continuous help tho.

Which param is not working ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.