Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

SNOW connector - businessjustification emergency role autoapprove issue

Anu
Regular Contributor
Regular Contributor

Hi Team,

We are trying to send businessjustifcation in the SNOW body and the below is the used code.The code works fine for enterprise role Manual or Autoapproval scenario as expected. In case of emergency roles no issue identified for manual approval request but when the request is autoapproved the requestor businesjustification is going as blank in SRQ.

Ideally businessjustifcation is only present on requestor page and it should not have anything to do with auto approval or manual approver but still facing this issue for emergency role alone. Could you please provide some insights if this can be fixed

\\\\n\\\\n\\\\n${String str='BusinessJustification'; return str;}:${businessJustification.contains('<br')? businessJustification.substring(0,businessJustification.indexOf('<')) : businessJustification} \\\\n\\\\n\\\\

Anu_0-1719920570672.png

There is no error as such in the logs but the value goes blank

 

3 REPLIES 3

Raghu
All-Star
All-Star

@Anu  try below

${task.requestKey==null?'':task.requestKey?.comments?.replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').replaceAll(new String('XFw='.decodeBase64()),new String('XFxcXA=='.decodeBase64()))}

or

${businessJustification}

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Anu
Regular Contributor
Regular Contributor

Hi @Raghu , we have already tried the above code ,but it still fails for autoapproval requests only for emergency roles.

AAR
New Contributor III
New Contributor III

Hi @Anu ,

You can try below which captures both entitlement and the corresponding business justification of each task.

 

${if(taskIds != null && taskIds.size()>0){String result=''; String result2=''; ArrayList arr = new ArrayList(taskIds); arr.eachWithIndex{val, idx ->com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey!=null ? result=result.concat(com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value+' : '+com.saviynt.ecm.task.ArsTasks.get(val)?.requestAccessKey?.comments.split(']')[1].split('<br')[0].toString().replaceAll('<.*?>','').replaceAll('\\n','').replaceAll('\\r','').replaceAll('[^ -~À-ÿ]+','').concat('###').trim()):'';}; result2=result.substring(0,result.length()-4); result2=result2.replaceAll('###','\\\\\\\\n');return result2;}else{return '';}}

 

Thanks,

Anush