# IdentityIQ Bulk Role Creation

**URL:** <https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626>\
**Category:** IIQ Discussion and Questions\
**Tags:** roles, identityiq\
**Created:** [May 6, 2024, 3:24pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626 "2024-05-06T15:24:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![micasrafael](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@micasrafael](https://developer.sailpoint.com/discuss/u/micasrafael)\
**Post date:** [May 6, 2024, 3:24pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/1 "2024-05-06T15:24:04Z")

</div>

### Which IIQ version are you inquiring about?

Version 8.3

### Share all details related to your problem, including any error messages you may have received.

Greetings to everyone,

I have a simple question: Is it possible to create Roles in bulk (via UI Administration Console, CSV file or API) in a standard version 8.3 of IdentityIQ?

It is just to understand better the plataform.

Best regard

---

<div class="post-metadata">

**Author:** ![kjakubiak](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kjakubiak/32/7052_2.png) [@kjakubiak](https://developer.sailpoint.com/discuss/u/kjakubiak)\
**Post date:** [May 6, 2024, 3:48pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/2 "2024-05-06T15:48:22Z")

</div>

Unfortunatelly not out of the box, there are couple of ways how to automate this operation but whichever option you take it will require more or less coding. Here are the options

1. You can write Run Rule to load them from csv file
2. You can create (generate via.some script) XML objects of roles and import them via gui or iiq console
3. You can write a jshell script to do basically the same as in point 1

I know Ventum created once role loader to IIQ - i will share it in colab if I get permission to do that. Give some time to check it.

---

<div class="post-metadata">

**Author:** ![vishal\_kejriwal1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vishal_kejriwal1/32/10904_2.png) [@vishal\_kejriwal1](https://developer.sailpoint.com/discuss/u/vishal_kejriwal1)\
**Post date:** [May 6, 2024, 5:10pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/3 "2024-05-06T17:10:16Z")

</div>

check  
[https://community.sailpoint.com/t5/IdentityIQ-Forum/How-to-create-IT-Role-using-api/m-p/109886#M92457](https://community.sailpoint.com/t5/IdentityIQ-Forum/How-to-create-IT-Role-using-api/m-p/109886#M92457)

This is for IT role

---

<div class="post-metadata">

**Author:** ![pbobadil](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pbobadil/32/10262_2.png) [@pbobadil](https://developer.sailpoint.com/discuss/u/pbobadil)\
**Post date:** [May 7, 2024, 2:23am UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/4 "2024-05-07T02:23:11Z")

</div>

Our third-party support introduces the Role Importer for IdentityIQ. This helped us a lot on creating a bulk role by calling a CSV File

---

<div class="post-metadata">

**Author:** ![micasrafael](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@micasrafael](https://developer.sailpoint.com/discuss/u/micasrafael)\
**Post date:** [May 7, 2024, 9:07am UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/5 "2024-05-07T09:07:22Z")

</div>

I am getting “Access Denied”. Is there any other source?

---

<div class="post-metadata">

**Author:** ![tswitz00](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tswitz00](https://developer.sailpoint.com/discuss/u/tswitz00)\
**Post date:** [May 7, 2024, 10:30am UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/7 "2024-05-07T10:30:41Z")

</div>

You can create a python script to create the managed attribute, IT role, Business Role, and workgroups for the Role. We exported each of these form debug for a test role, and then use a spreadsheet that hold each needed value and generate each of those XML attributes into a single XML that we can bulk import into IIQ, this also allows us to save a baseline. We do this for all roles additions, so we have an XML file for all roles within the system.

---

<div class="post-metadata">

**Author:** ![vishal\_kejriwal1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vishal_kejriwal1/32/10904_2.png) [@vishal\_kejriwal1](https://developer.sailpoint.com/discuss/u/vishal_kejriwal1)\
**Post date:** [May 7, 2024, 7:43pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/8 "2024-05-07T19:43:52Z")

</div>

```auto
Code:

import sailpoint.object.Bundle;
import sailpoint.object.Application;
import sailpoint.object.Identity;
import sailpoint.object.Profile;
import sailpoint.object.Attributes;
import sailpoint.object.Filter;
import sailpoint.tools.Util;

  Bundle new_role = new Bundle();
  new_role.setName("Test IT Role");
  new_role.setOwner(context.getObjectByName(Identity.class,"spadmin"));
  new_role.setType("it");
    Filter f = Filter.eq("groups", "cn=Contractors,ou=groups,dc=training,dc=sailpoint,dc=com"); 

    Profile p = new Profile(); 
    p.addConstraint(f); 

    Application entApplication = context.getObjectByName(Application.class, "LDAP"); 
    p.setApplication(entApplication); 
    new_role.add(p); 
  
context.saveObject(new_role); 
  context.commitTransaction(); 

Resultant Role:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Bundle PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Bundle created="1545236335950" id="ff80808167a5cd090167c7434d4e0516" name="Test IT Role" type="it">

  <Owner>
    <Reference class="sailpoint.object.Identity" id="ff80808161b5196e0161b51993560105" name="spadmin"/>
  </Owner>

  <Profiles>
    <Profile created="1545236335951" id="ff80808167a5cd090167c7434d4f0517">
      <ApplicationRef>
        <Reference class="sailpoint.object.Application" id="ff80808161b51a2a0161b51a4515000d" name="LDAP"/>

      </ApplicationRef>
      <Constraints>
        <Filter operation="EQ" property="groups" value="cn=Contractors,ou=groups,dc=training,dc=sailpoint,dc=com"/>

      </Constraints>
    </Profile>
  </Profiles>

</Bundle>

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 6, 2024, 7:44pm UTC](https://developer.sailpoint.com/discuss/t/identityiq-bulk-role-creation/55626/9 "2024-07-06T19:44:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
