Sailpoint ISC Bulk AccessProfile and Role Importer issue in adding entitlement

Problem

Have been trying to use Sailpoint identitynow bulk importer but i stuck in a situation where need to create 430+ access profiles for SAP application. However the issue with the template is where we define entitlements. for instance we provide
AttributeName:entitlementNames
in my current requirement there is a colon in entitlement itself.

logsys_agr:LSQCLNT200_ZS3C:FI_AP_DELV_LD_GLBL

The script is invoked successfully & created access profiles without entitlements
→>
it says entitlement not found

Diagnosis



———————–

Solution:
——————
https://community.sailpoint.com/t5/Professional-Services/IdentityNow-Bulk-Access-Profile-and-Role-Importer/ta-p/77382?_gl=1*1wcnyw6*_gcl_au*MTg0NjA3ODA2OS4xNzU1OTM0MzMwLjM5ODkxNDY0NS4xNzU3NTc4MDc3LjE3NTc1NzgwNzY.*_ga*MzE3NjI0ODMwLjE2OTk0Njk5OTY.*_ga_CDHGD2GT5X*czE3NTg5MzA5NzIkbzE0MSRnMSR0MTc1ODkzMTk1OSRqMTAkbDAkaDA.

tried replacing this code: it did not helped

if present(accessProfileSourceNewID) && present(entitlementList) then
  attributesEntitlementHash = {}

  # Split the entitlementList by semicolon to separate individual attribute:entitlement pairs.
  # Example input: "logsys_agr:LSQCLNT200_ZS3C:FI_AP_IP_TM_ANLYST_NA;anotherAttr:anotherEntitlement"
  accessProfileEntitlements = entitlementList.split(';')

  # Iterate through each attribute:entitlement pair.
  accessProfileEntitlements.each do |entitlement|
    # Split the pair on the first colon to get the attribute name and the full entitlement value.
    parts = entitlement.split(':', 2)

    # Check for proper formatting before proceeding.
    if parts.length == 2
      # The first part is the attribute name.
      attributeName = parts[0]
      # The second part is the rest of the string, which is the full entitlement value.
      attributeValue = parts[1]

      # Add the entitlement to the hash.
      if attributesEntitlementHash.key?(attributeName)
        attributesEntitlementHash[attributeName] << attributeValue
      else
        attributesEntitlementHash[attributeName] = [attributeValue]
      end
    else
      puts "ERROR: Create Access Profile: entitlementList is not properly formatted. The provided value is: '#{entitlement}'"
      stopFlag = true
    end
  end
end 

Hey @osmanmohammed ,

Yeah, I see what’s happening. the script using splits everything on : so when your entitlement value itself contains a colon (like groups:XX:XX) it gets cut off and code only sees FI_AP_DELV_LD_GLBL.

I’ve updated the logic so it only splits on the first colon (ignoring escaped ones), and it also treats \: as a real colon. That way you can safely pass entitlements like groups:xx\:xx;groups:yy\:yy

line 1064 to 1093

 if present(accessProfileSourceNewID) && present(entitlementList) then
            # attributesEntitlementHash is used to store the attributes/entitlements like this :
            # {
            #   "attribute 1" => ["entitlement 1.1","entitlement 1.2"],
            #   "attribute 2" => ["entitlement 2.1","entitlement 2.2"]
            # }
            attributesEntitlementHash = Hash.new

            # split the value of column_4 (it looks like this attributeName1:entitlement1;attributeName2:entitlement2)
            accessProfileEntitlements = entitlementList.split(';')

            # split the value of each pair attributeName1:entitlement1
            accessProfileEntitlements.each do |entitlement|
              # Split only on the first unescaped colon
              parts = entitlement.split(/(?<!\\):/, 2)
              attributeName  = parts[0]
              attributeValue = parts[1]

              # Unescape "\:" back to ":"
              attributeName  = attributeName.gsub('\:', ':') if attributeName
              attributeValue = attributeValue.gsub('\:', ':') if attributeValue

              if !present(attributeName) || !present(attributeValue)
                puts "ERROR   : Create Access Profile : entitlementList is not properly formatted, it should be attr1:ent1;attr2:ent2, the provided value is : '#{entitlementList}'"
                stopFlag = true
              else
                if attributesEntitlementHash[attributeName].nil?
                  attributesEntitlementHash[attributeName] = [attributeValue]
                else
                  attributesEntitlementHash[attributeName] << attributeValue
                end
              end
            end
          end

attached updated script below
roleImporter.rb (136.1 KB)

Also, have you tried using the VS Code extension to import Access Profiles?

hope that helps!

do you have a sample template to import APs and Roles via VS-Code ?

Yeah, you can check out the schema Access Profiles and Roles.

Also, you can export directly from Plugin to see the full schema.