I have a "Ticket" class with an "AttributeExternalKey" field that points to a typology class.
This typology class has an org_id field to select the associated organization.
On my "Ticket," if my user has access to all organizations, they will see all the entries in my typology class (which is normal). However, if they select an organization in the sidebar, they still see all the entries in that field, regardless of the organization (which shouldn't be the case since I've selected one organization).
A user who doesn't have access to all organizations will only see the entries for their own organization.
Do you know how I can solve this problem?
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Guillaume,
We have not implemented that the organization selector restrict the external Key selection when editing an object. In your mind, it make sense to restrict the typology value based on the selected organization, but if we were applying this rule, then you could no more select a Service which would not be delivered by the customer organization, while creating a User Request in console which the Customer Selected, you could not select an agent or a team,... clearly, there are very good reason not to do it.
And for your particular need:
You can ask the agents to use the magnifier and filter the typology based on a particular organization.
Or if there is a rule defining when the typology values must be restricted and when its free, maybe you can code it with the typology external key OQL filter...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@cisou
Could you help me with the request, because the problem is that the selected org is not the same as the typo org. The org inside my class is a child or of the main org, where my typo are linked.
ORG_parent (all my typo are linked here
Child_org (my "Ticket are linked to this)
So i think it will be hard with the filter : <filter><![CDATA[SELECT Type WHERE org_id = $this->org_id]]></filter>
in the filter we cannot have php code ?
Maybe with a method PrefillCreationForm ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Express your need more clearly?
Do you want to restrict the proposed typology, based on
1. a User Profile
2. Particular Customers
3. Particular Service or Service-subcategories
4. The requestor organization and its parent(s)
If you have no clear rule to decide when to limit the proposed typology to those of the customer, versus all the typology, then the only possible filter I can think of, is to always propose the ticket requestor organization owned Types and all the generic Types defined on the Parent organization(s) - (option 4)
This filter n°4 has the advantage not to propose any specific Types which would apply only to a different sub-organization than the one of the requestor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Type :
- TOTO (linked to A org)
- TITI (linked to A org)
- TATA (linked to C org)
- TUTU (linked to C org)
The user connected (can see every org) can create a "Ticket" (custom class) On the creation form, we select the org of the ticket, we select B.
With the org B selected i would like to see only the Type linked to A
And if we create a "Ticket" linked to org C i would like to see only the Type linked to C
Is it better ? :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's working in the run query menu and when i edit an already existing "Ticket".
But when i try to create a new one, nothing is shown in the field select Type :/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes,
This is how i define the org on the Ticket :
<field id="user-content-org_id" xsi:type="AttributeExternalKey">
<filter><![CDATA[SELECT Organization AS org
JOIN Location AS loc ON loc.org_id=org.id
WHERE loc.id=:this->location_id]]></filter></field>
So when i open the creation form, i need to select a Location, then the org from the location populate the Org field.
andmyfieldtypearelikethis:<fieldid="ticketType_id"xsi:type="AttributeExternalKey"><filter><![CDATA[SELECT CD_TicketType AS t JOIN Organization AS root ON t.org_id=root.id JOIN Organization AS child ON child.parent_id BELOW root.id WHERE child.id = :this->org_id]]></filter><sql>ticketType</sql><target_class>CD_TicketType</target_class><is_null_allowed>false</is_null_allowed><on_target_delete>DEL_MANUAL</on_target_delete><allow_target_creation>false</allow_target_creation></field><fieldid="ticketType_name"xsi:type="AttributeExternalField"><extkey_attcode>ticketType_id</extkey_attcode><target_attcode>name</target_attcode></field>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oups it's a small typo, this is the correct field on the Ticket :
<fieldid="org_id"xsi:type="AttributeExternalKey"><filter><![CDATA[SELECT Organization AS org JOIN Location AS loc ON loc.org_id=org.id WHERE loc.id=:this->location_id]]></filter><sql>org_id</sql><target_class>Organization</target_class><is_null_allowed>false</is_null_allowed><on_target_delete>DEL_AUTO</on_target_delete><allow_target_creation>false</allow_target_creation><dependencies><attributeid="location_id"/></dependencies></field><fieldid="org_name"xsi:type="AttributeExternalField"><extkey_attcode>org_id</extkey_attcode><target_attcode>name</target_attcode></field>
Last edit: Guillaume Vaillant 2 days ago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have a "Ticket" class with an "AttributeExternalKey" field that points to a typology class.
This typology class has an org_id field to select the associated organization.
On my "Ticket," if my user has access to all organizations, they will see all the entries in my typology class (which is normal). However, if they select an organization in the sidebar, they still see all the entries in that field, regardless of the organization (which shouldn't be the case since I've selected one organization).
A user who doesn't have access to all organizations will only see the entries for their own organization.
Do you know how I can solve this problem?
Thank you
Have you considered simply renaming "org_id" to a different name?
"org_id" is kind of a special field in iTop, which can restrict visibility.
Hello,
This is what i want, when i select the org on the sidebar i want to only see the Typology from the selected org.
Hi Guillaume,
We have not implemented that the organization selector restrict the external Key selection when editing an object. In your mind, it make sense to restrict the typology value based on the selected organization, but if we were applying this rule, then you could no more select a Service which would not be delivered by the customer organization, while creating a User Request in console which the Customer Selected, you could not select an agent or a team,... clearly, there are very good reason not to do it.
And for your particular need:
You can ask the agents to use the magnifier and filter the typology based on a particular organization.
Or if there is a rule defining when the typology values must be restricted and when its free, maybe you can code it with the typology external key OQL filter...
Hi Vincent,
thank you for your answer.
I think i'll put a filter on the field where i need to get specific Typology linked to org.
@cisou
Could you help me with the request, because the problem is that the selected org is not the same as the typo org. The org inside my class is a child or of the main org, where my typo are linked.
ORG_parent (all my typo are linked here
Child_org (my "Ticket are linked to this)
So i think it will be hard with the filter : <filter><![CDATA[SELECT Type WHERE org_id = $this->org_id]]></filter>
in the filter we cannot have php code ?
Maybe with a method PrefillCreationForm ?
Express your need more clearly?
Do you want to restrict the proposed typology, based on
1. a User Profile
2. Particular Customers
3. Particular Service or Service-subcategories
4. The requestor organization and its parent(s)
If you have no clear rule to decide when to limit the proposed typology to those of the customer, versus all the typology, then the only possible filter I can think of, is to always propose the ticket requestor organization owned Types and all the generic Types defined on the Parent organization(s) - (option 4)
This filter n°4 has the advantage not to propose any specific Types which would apply only to a different sub-organization than the one of the requestor.
So.
Org :
A (parent)
- B (child)
C (other parent)
Type :
- TOTO (linked to A org)
- TITI (linked to A org)
- TATA (linked to C org)
- TUTU (linked to C org)
The user connected (can see every org) can create a "Ticket" (custom class) On the creation form, we select the org of the ticket, we select B.
With the org B selected i would like to see only the Type linked to A
And if we create a "Ticket" linked to org C i would like to see only the Type linked to C
Is it better ? :)
The option 4 should do the work.
Thank you, i've try,
It's working in the run query menu and when i edit an already existing "Ticket".
But when i try to create a new one, nothing is shown in the field select Type :/
Have you selected a Customer, before opening the drop-down field Type ?
yes,
This is how i define the org on the Ticket :
<field id="user-content-org_id" xsi:type="AttributeExternalKey">
<filter><![CDATA[SELECT Organization AS org
JOIN Location AS loc ON loc.org_id=org.id
WHERE loc.id=:this->location_id]]></filter></field>
So when i open the creation form, i need to select a Location, then the org from the location populate the Org field.
Should the Typology be based on the "org_id" or "user-content-org_id"?
In the second case, you must change the filter to reference the second field
Hello Vincent,
Oups it's a small typo, this is the correct field on the Ticket :
Last edit: Guillaume Vaillant 2 days ago
Last edit: Guillaume Vaillant 2 days ago
Do you think it's because the org_id of my Ticket class is from a parent class ?
the org_id field is defined in CD_Ticket