Hello Everyone,
User has 3-4 accounts of same source (accounts can be less or more. We have taken “TicketNumber” attribute as AccountId. So whenever Ticket is created we get different ticketNumber so multiple accounts will be created with same source to user).
We have created identity attribute “TicketStatus” which is taking value from above source (" cais_temp_account_creation delimited") and we have attribute “TicketStatusUpdated” in this source . If that attribute value is “TBU” in every account( same source accounts) then we need to update identity attribute “TicketStatus” to “TBU” else if atleast in one account it is value is not “TBU” then make it “Open”.
For this we have written transform
{
"name": "ticketstatus",
"transform": {
"type": "static",
"attributes": {
"value": "#set($allTBU = true)
#foreach($account in $user.accounts)
#if($account.get(\"sourceName\") == \"cais_temp_account_creation delimited\")
#if($account.get(\"TicketStatusUpdated\") != \"TBU\")
#set($allTBU = false)
#break
#end
#end
#end
#if($allTBU) $identity.set(\"TicketStatus\", \"TBU\")
#else $identity.set(\"TicketStatus\", \"Open\")
#end"
}
}
}
Does this foreach loop takes user accounts? if not any other soultion for this . can someone please help.
Thank You
