Set up asset reference on same object type
Asked by Benjamin W_:

Hi folks

we have the following **set up:**

* our users are grouped into multiple Active Directory domains
* for each domain, we have an import into asset into one object schema (so one object scheme with multiple objecttypes)
* each user has two attributes
  * DN = Active Directory distinguished Name of the account itself
  * ManagerDN = Active Directory distinguished Name of the account of the manager
* the ManagerDN of one user references to the DN of another user

**What we want to achieve:**

* this reference shall be displayed on the user object, so we can make use of it for approval workflows
* so far I have only seen ways how to reference one object to another object type (e.g. to Jira user objects), but not within the same object type.

**Question:**

* is it possible to make references based on a specific attribute within the same object type?
* or is it necessary to have an object type with unique managerDNs in order to make the reference against this object type?

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/301661iC5750A298991D4FB/image-size/large?v=v2&px=999 "image.png")

Thanks for your help on this.

Regards, Benjamin


Answers:
author: Eugenio Onofre
body: Hi [@Benjamin W_](/t5/user/viewprofilepage/user-id/2421210)

In Atlassian Assets, object references are typically designed to link different object types. However, there are ways to approach this:

1. **Using Automation or Scripting**: Custom scripts or automation rules could read the ManagerDN attribute and then find and link the corresponding user object with the same DN. This approach might require additional scripting or API usage.

2. **Creating a Separate Object Type for Managers**: As you suggested, another approach is to create a separate object type for managers. This way, you can easily reference managers in the user objects. Though this might seem redundant, it simplifies the reference process since Assets is designed to handle references between different object types more straightforwardly.

Please remember to accept this answer in case it helps you resolve your question as it may also help other community members in the future.

Regards,  
Eugenio

comments: author: Benjamin W_
body: Hi [@Eugenio Onofre](/t5/user/viewprofilepage/user-id/4992586)

thanks for your feedback and confirmation for our assumption.  
We want to follow the second approach with an additional Object Type.  
But unfortunately we are not able to set it up correctly.  
Maybe you can give me a hint why it is failing?

So far we have:

1. set up a new Object Type "AD Manager"
2. set up new import from LDAP AD "AD Global Catalog" into Object Type "AD Manager"
3. define import attribute distinguishedName as Asset attribute distinguishedName
4. import users successfully, distinguishedName is filled correctly (e.g. CN=John Doe,OU=Users,OU=Company,DC=ACME,DC=net)
5. on existing Object Type "AD User" add new attribute "AD Manager" of type "Object" and Type Value "AD Manager"
6. within the Object Type Mapping for "AD User" add new Data locator "manager" on Assets Attribute "AD Manager" and Object mapping

   ```
   objectType="AD Manager" AND "distinguishedName" IN (${manager${0}})
   ```

7. synch both AD Manager and AD User.
8. field "AD Manager" does not show up. Server-Log does not show anything.

I checked out the documentation <https://support.atlassian.com/jira-service-management-cloud/docs/add-a-reference/> and for the syntax of AQL here <https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/>, but unfortunately seems I yet do not fully understand the principle on the references.  
A former colleague successfully added a reference from "AD User" to the Jira users with this same syntax. So I am wondering what I am missing.

In fact - field manager from "AD User" maps field distinguishedName from "AD Manager". Actually, simple :-)

User:

![AD-User.png](https://community.atlassian.com/t5/image/serverpage/image-id/301660i7E04E1E737B1B4EE/image-size/large?v=v2&px=999 "AD-User.png")

Manager:

![AD-Manager.png](https://community.atlassian.com/t5/image/serverpage/image-id/301659i43603859EC575FA1/image-size/large?v=v2&px=999 "AD-Manager.png")

Do you know how I can make further steps to get my requirement done? Is there any documentation in this AQL in regards to references?

Thank you very much.

Best regards,  
Benjamin


author: Eugenio Onofre
body: Hi [@Benjamin W_](/t5/user/viewprofilepage/user-id/2421210)

Sure. Please see below the AQL documentation:  
<https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/>

You can look for Reference functions in the doc.

Please remember to accept this answer in case it helps you resolve your question as it may also help other community members in the future.

Regards,  
Eugenio


author: Benjamin W_
body: Hello [@Eugenio Onofre](/t5/user/viewprofilepage/user-id/4992586)

thank you for the details.

I was playing around a bit, but unfortunately so far I have not get it working. In the meantime, our project where we need this scenario has been postponed to whenever.. so we also paused working on this. As soon it gets relevant I will share our results here with the Community.

Regards, Benjamin


Tags: jira-service-management

jira-service-management-server

server