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

Pass Request ID in DISABLEACCOUNT json for AD connection

Bhargav
New Contributor
New Contributor

Hello Team,

We have a requirement to pass Request ID in DISABLEACCOUNT JSON for Serive Accounts in AD connection. So my requirement is

if request id is null/blank then the description can be like -
"Disabled by Saviynt IGA DEV ${Calendar.getInstance().getTime().format('yyyy-MM-dd hh:mm:ss')}"
and if the request id is present then description can be like -
"This account has been disabled based on the saviynt request $requestno"

I have tried with below syntax but in Description field it prints all the condition.

{
"moveUsertoOU":"OU=Other,OU=Users,OU=Disabled Users,DC=DEVGUWW,DC=NET",
"deleteAllGroups":"No",
"userAccountControl":"514",
"description": "${task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.')+1)}==' '?'Disabled by Saviynt IGA DEV ${Calendar.getInstance().getTime().format('yyyy-MM-dd hh:mm:ss')}':'This account has been disabled based on the saviynt request ${task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.')+1)}'" }

And its printing like this in Description: 

330052==''?'Disabled by Saviynt IGA DEV 2023-08-23 02:23:01':'This account has been disabled based on the saviynt request 330052'

Can someone help me with syntax?

Thanks,

Bhargav.

2 REPLIES 2

pmahalle
All-Star
All-Star

Hi @Bhargav ,

Can you try below DISABLEACCOUNT json:

{
"moveUsertoOU":"OU=Other,OU=Users,OU=Disabled Users,DC=DEVGUWW,DC=NET",
"deleteAllGroups":"No",
"userAccountControl":"514",
"description": "${if(task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.')+1)==' '){'Disabled by Saviynt IGA DEV '+ Calendar.getInstance().getTime().format('yyyy-MM-dd hh:mm:ss')} else{'This account has been disabled based on the saviynt request '+ task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.')+1)}}"
}


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

dgandhi
All-Star
All-Star

Can you try with if -else condition?

Sample:

"description": "${if(user.customproperty32?.contains('Disable_Account') || user.customproperty36?.contains('LOA')) {user?.locationdesc+'-'+user?.title} else {user?.customproperty35}}", 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.