I try to add a new status between "new" and "assigned" which is "validation", but i have an issue with the toolkit and the status does not appears in iTop menus.
In the toolkit i have the message:
"Class UserRequest
Attribute 'status' (object state) has an allowed value (validation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('new, escalated_tto, assigned, escalated_ttr, waiting_for_approval, approved, rejected, pending, resolved, closed')], or reconsider the list of states)"
But, if i look into the "itop/env-production/itop-request-mgmt-itil/model.itop-request-mgmt-itil.php", i have the good line with :
In that link (https://www.itophub.io/wiki/page?id=2_3_0%3Auser%3Aactions) they saids:
*"The actions available on each object depend on:
The life-cycle of the object (each type of object may have a different life-cycle)
The current state of the object (not all actions are possible in all states)
The user-rights as defined by her/his profile(s): some actions are restricted to a given profile."*
I try to go to validation state from new but i can't, i'm administrator and i define the state and the life-cycle.
The extension do:
FIELDS
1- add status in <fields><field id="user-content-status"><values><value id="user-content-validation">validation
2- add status in tto field
3- add status in ttr field
LIFECYLE
4- add a stimulus ev_validation
5- update the state new to permit new=>validation and SetCurrentDate in a field validation_date
6- create the state "validation"</value></values></field></fields>
in the module.extension.php, i have:
'dependencies' => array(
'itop-tickets/2.4.0',
'itop-portal/2.4.0',
'itop-request-mgmt/2.4.0',
'itop-request-mgmt-itil/2.4.0',
'itop-incident-mgmt-itil/2.4.0',
more than i need because my extension also modify others things in others classes.
Ok... I'm a noob... I fix it... but i'm a noob >.<
All i did was fine but i simply wrote "<livecycle>" instead of "<lifecycle>" and i didn't really correctly use the _delta option.</lifecycle></livecycle>
Now it's work, you can see it in "/env-production/itop-request-mgmt-itil/model.itop-request-mgmt-itil.php"
Hello,
Thanks for the feedback Ajyb :)
Just a quick remark : writing directly in iTop files is not recommended as those files will be overwritten on next iTop update (2.5 will be out soon O:) ). You'd better add your modifications using a custom module... There are some tutorials in the documentation : https://www.itophub.io/wiki/page?id=2_4_0%3Acustomization%3Astart#by_writing_your_own_extension
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have to ask a little thing about that modification. Well i created a new status, cool but somes users said to me they don't see the new status in the menu. I check the profils and i see that i have to update the list of "stimulis" they can use.
So my question is simple, how can i update some profils to add a stimuli to it ? (through extension, through profiles, ...)
I search in the xml datamodels of itop and i found this bellow:
Hi,
I try to add a new status between "new" and "assigned" which is "validation", but i have an issue with the toolkit and the status does not appears in iTop menus.
In the toolkit i have the message:
"Class UserRequest
Attribute 'status' (object state) has an allowed value (validation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('new, escalated_tto, assigned, escalated_ttr, waiting_for_approval, approved, rejected, pending, resolved, closed')], or reconsider the list of states)"
But, if i look into the "itop/env-production/itop-request-mgmt-itil/model.itop-request-mgmt-itil.php", i have the good line with :
If i look into itop in data model i have the status:
https://www.noelshack.com/2018-25-4-1529591385-status.png
In that link (https://www.itophub.io/wiki/page?id=2_3_0%3Auser%3Aactions) they saids:
*"The actions available on each object depend on:
The life-cycle of the object (each type of object may have a different life-cycle)
The current state of the object (not all actions are possible in all states)
The user-rights as defined by her/his profile(s): some actions are restricted to a given profile."*
I try to go to validation state from new but i can't, i'm administrator and i define the state and the life-cycle.
The extension do:
FIELDS
1- add status in <fields><field id="user-content-status"><values><value id="user-content-validation">validation
2- add status in tto field
3- add status in ttr field
LIFECYLE
4- add a stimulus ev_validation
5- update the state new to permit new=>validation and SetCurrentDate in a field validation_date
6- create the state "validation"</value></values></field></fields>
in the module.extension.php, i have:
'dependencies' => array(
'itop-tickets/2.4.0',
'itop-portal/2.4.0',
'itop-request-mgmt/2.4.0',
'itop-request-mgmt-itil/2.4.0',
'itop-incident-mgmt-itil/2.4.0',
more than i need because my extension also modify others things in others classes.
Extension: datamodel.extension.xml
Can anyone tell me what i messed, maybe i have to add the stimulus manually in "Other_actions" ? But how ?
Thanks.
Last edit: Ajyb 2018-06-22
Hi,
I looked to the file "itop/env-production/itop-request-mgmt-itil/model.itop-request-mgmt-itil.php" again and i see another thing.
I don't have transitions update in this file. I have the new state "validation" but i don't have the lifecycle transition and state:
When i grep on my php file with "validation" i don't found any ev_validation or any line with stimulus.
I will search that way.
Ok... I'm a noob... I fix it... but i'm a noob >.<
All i did was fine but i simply wrote "<livecycle>" instead of "<lifecycle>" and i didn't really correctly use the _delta option.</lifecycle></livecycle>
Now it's work, you can see it in "/env-production/itop-request-mgmt-itil/model.itop-request-mgmt-itil.php"
I give you my code:
Hello,
Thanks for the feedback Ajyb :)
Just a quick remark : writing directly in iTop files is not recommended as those files will be overwritten on next iTop update (2.5 will be out soon O:) ). You'd better add your modifications using a custom module... There are some tutorials in the documentation : https://www.itophub.io/wiki/page?id=2_4_0%3Acustomization%3Astart#by_writing_your_own_extension
Hi,
I'm already using an extension an compile the code with the toolkit.
Maybe i can use less code XML to do what i want but, it's working so... ^^
Ok, perfect !
Hi,
I have to ask a little thing about that modification. Well i created a new status, cool but somes users said to me they don't see the new status in the menu. I check the profils and i see that i have to update the list of "stimulis" they can use.
So my question is simple, how can i update some profils to add a stimuli to it ? (through extension, through profiles, ...)
I search in the xml datamodels of itop and i found this bellow:
I suppose it's just that and it will work but i have to test it.
I test it and it's working, the profile is updated and functional.