Please debug my code

Abdul
Tera Contributor

Hi

 

I wrote the attached code.

The logic is that we have a dropdown in a catalog item with the roles that needs to be added.

And we have check boxes identifying in which environment the role should be provided.

When i select the Role as Admin and select any environment, i am facing the below error.

 

Username: ajdoerksen, Group: [] ERROR MESSAGE: Cannot find an object with identity: '[]' under: 'DC=parkland,DC=domain'.', ERROR: Username: ajdoerksen, Group: [] ERROR MESSAGE: Cannot find an object with identity: '[]' under: 'DC=parkland,DC=domain'.

 

This code works for Production->User and Production->Super User. And UAT-> User and UAT->Super User.

Since the code works for other 2 and just not working for Admin role i am getting confused.

Are there any issues with my logic or code? Please help me.

Abdul_0-1747201769970.pngAbdul_1-1747201817993.pngAbdul_3-1747201836410.png

 

 

5 REPLIES 5

Arun_Manoj
Mega Sage

Hi @Abdul ,

 

Is it Domain seperated instance using?

 

Abdul
Tera Contributor

i dont understand what that means? We have an AD for Prod alone and this is lower instances.

Ankur Bawiskar
Tera Patron
Tera Patron

@Abdul 

did you try to replicate the issue in lower environment?

Are you sure the error you are showing is for that script only?

Because both are different things.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

the issue is in lower environment only.

so basically when this script runs it sends the details to another group to add the user to a group automatically.

Does this script looks good?

are there any issue with logic or coding?

 

Thanks